aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/scroll_control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-12-06 21:09:12 +0800
committercrupest <crupest@outlook.com>2018-12-06 21:09:12 +0800
commit03ef76f769a55b694905898c16a176fc6bd4b0d7 (patch)
tree41e11ed127f9a35f543473c39109487785383daa /src/ui/controls/scroll_control.cpp
parent81fd0725d020e9f302c0d40fd5a5700d3dc871aa (diff)
downloadcru-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.cpp3
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();