mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:58:14 +00:00
LibGUI: Add ScrollableWidget helpers for rect conversion
to_content_rect() and to_widget_rect() help you convert rects from one coordinate space to the other.
This commit is contained in:
parent
00dc615d53
commit
50aab509ce
1 changed files with 3 additions and 0 deletions
|
@ -77,6 +77,9 @@ public:
|
|||
Gfx::IntPoint to_content_position(const Gfx::IntPoint& widget_position) const;
|
||||
Gfx::IntPoint to_widget_position(const Gfx::IntPoint& content_position) const;
|
||||
|
||||
Gfx::IntRect to_content_rect(const Gfx::IntRect& widget_rect) const { return { to_content_position(widget_rect.location()), widget_rect.size() }; }
|
||||
Gfx::IntRect to_widget_rect(const Gfx::IntRect& content_rect) const { return { to_widget_position(content_rect.location()), content_rect.size() }; }
|
||||
|
||||
protected:
|
||||
ScrollableWidget();
|
||||
virtual void custom_layout() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue