mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
WindowServer: Position popup menu with offset of 1 pixel
This commit is contained in:
parent
a4f320c76b
commit
b0682a73ee
Notes:
sideshowbarker
2024-07-18 16:58:37 +09:00
Author: https://github.com/matthewbjones Commit: https://github.com/SerenityOS/serenity/commit/b0682a73ee2 Pull-request: https://github.com/SerenityOS/serenity/pull/7713 Issue: https://github.com/SerenityOS/serenity/issues/5474
|
@ -588,6 +588,8 @@ void Menu::do_popup(const Gfx::IntPoint& position, bool make_input, bool as_subm
|
|||
|
||||
if (adjusted_pos.x() + window.width() >= Screen::the().width() - margin) {
|
||||
adjusted_pos = adjusted_pos.translated(-window.width(), 0);
|
||||
} else {
|
||||
adjusted_pos.set_x(adjusted_pos.x() + 1);
|
||||
}
|
||||
if (adjusted_pos.y() + window.height() >= Screen::the().height() - margin) {
|
||||
adjusted_pos = adjusted_pos.translated(0, -min(window.height(), adjusted_pos.y()));
|
||||
|
|
Loading…
Reference in a new issue