diff options
author | crupest <crupest@outlook.com> | 2018-12-06 21:09:12 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-12-06 21:09:12 +0800 |
commit | 03ef76f769a55b694905898c16a176fc6bd4b0d7 (patch) | |
tree | 41e11ed127f9a35f543473c39109487785383daa /src/ui/controls/scroll_control.cpp | |
parent | 81fd0725d020e9f302c0d40fd5a5700d3dc871aa (diff) | |
download | cru-03ef76f769a55b694905898c16a176fc6bd4b0d7.tar.gz cru-03ef76f769a55b694905898c16a176fc6bd4b0d7.tar.bz2 cru-03ef76f769a55b694905898c16a176fc6bd4b0d7.zip |
Fix position cache bug.
Diffstat (limited to 'src/ui/controls/scroll_control.cpp')
-rw-r--r-- | src/ui/controls/scroll_control.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/controls/scroll_control.cpp b/src/ui/controls/scroll_control.cpp index ae99f414..622b4e4c 100644 --- a/src/ui/controls/scroll_control.cpp +++ b/src/ui/controls/scroll_control.cpp @@ -328,11 +328,12 @@ namespace cru::ui::controls { if (const auto child = GetChild()) { - const auto old_position = child->GetPositionRelative(); + const auto old_position = child->GetOffset(); child->SetRect(Rect(Point( old_position.x + old_offset_x - offset_x_, old_position.y + old_offset_y - offset_y_ ), child->GetSize())); + child->RefreshDescendantPositionCache(); } } InvalidateDraw(); |