mirror of
https://github.com/RGBCube/serenity
synced 2025-07-01 14:52:06 +00:00
LibGUI: Add GScrollableWidget::to_widget_position()
This is a complement to to_content_position() :^)
This commit is contained in:
parent
fc53867937
commit
33043941f9
2 changed files with 9 additions and 0 deletions
|
@ -188,3 +188,11 @@ Point GScrollableWidget::to_content_position(const Point& widget_position) const
|
|||
content_position.move_by(-frame_thickness(), -frame_thickness());
|
||||
return content_position;
|
||||
}
|
||||
|
||||
Point GScrollableWidget::to_widget_position(const Point& content_position) const
|
||||
{
|
||||
auto widget_position = content_position;
|
||||
widget_position.move_by(-horizontal_scrollbar().value(), -vertical_scrollbar().value());
|
||||
widget_position.move_by(frame_thickness(), frame_thickness());
|
||||
return widget_position;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue