mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 16:02:53 +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
Notes:
sideshowbarker
2024-07-19 11:44:40 +09:00
Author: https://github.com/awesomekling
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