aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/scroll_control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-12-05 16:37:58 +0800
committercrupest <crupest@outlook.com>2018-12-05 16:37:58 +0800
commit8898aee6c70bde922ee5de2a6213a44798525a16 (patch)
tree90b6fc6eb526e2421458f942f390906d6a48a628 /src/ui/controls/scroll_control.cpp
parent01b0378ed32eb2011863393892717483004cc375 (diff)
downloadcru-8898aee6c70bde922ee5de2a6213a44798525a16.tar.gz
cru-8898aee6c70bde922ee5de2a6213a44798525a16.tar.bz2
cru-8898aee6c70bde922ee5de2a6213a44798525a16.zip
...
Diffstat (limited to 'src/ui/controls/scroll_control.cpp')
-rw-r--r--src/ui/controls/scroll_control.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/controls/scroll_control.cpp b/src/ui/controls/scroll_control.cpp
index db8ac438..8358abc5 100644
--- a/src/ui/controls/scroll_control.cpp
+++ b/src/ui/controls/scroll_control.cpp
@@ -283,7 +283,7 @@ namespace cru::ui::controls
return result;
}
- void ScrollControl::OnLayoutContent(const Rect& rect)
+ void ScrollControl::OnLayoutContent(const Rect& rect, const AdditionalLayoutInfo& additional_info)
{
auto layout_rect = rect;
@@ -304,11 +304,11 @@ namespace cru::ui::controls
control->Layout(Rect(Point(
calculate_anchor(rect.left, layout_rect.width, size.width, offset_x_),
calculate_anchor(rect.top, layout_rect.height, size.height, offset_y_)
- ), size));
+ ), size), additional_info);
}
}
- void ScrollControl::AfterLayoutSelf()
+ void ScrollControl::OnRectChange(const Rect& old_rect, const Rect& new_rect)
{
UpdateScrollBarBorderInfo();
CoerceAndSetOffsets(offset_x_, offset_y_, false);
@@ -330,10 +330,10 @@ namespace cru::ui::controls
for (auto child : GetChildren())
{
const auto old_position = child->GetPositionRelative();
- child->SetPositionRelative(Point(
+ child->SetRect(Rect(Point(
old_position.x + old_offset_x - offset_x_,
old_position.y + old_offset_y - offset_y_
- ));
+ ), child->GetSize()));
}
}
InvalidateDraw();