WindowServer: Tweak width/height of automatic window tile rects
The resulting window rects when snapping to some edges/corners were a bit lopsided. This patch makes them symmetrical. :^)
This commit is contained in:
parent
5497b7a718
commit
a47d576e94
Notes:
sideshowbarker
2024-07-18 18:24:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a47d576e944
1 changed files with 4 additions and 4 deletions
|
@ -764,12 +764,12 @@ Gfx::IntRect Window::tiled_rect(WindowTileType tiled) const
|
|||
case WindowTileType::Top:
|
||||
return Gfx::IntRect(0,
|
||||
menu_height,
|
||||
Screen::the().width() - frame_width,
|
||||
Screen::the().width(),
|
||||
(max_height - titlebar_height) / 2 - frame_width);
|
||||
case WindowTileType::Bottom:
|
||||
return Gfx::IntRect(0,
|
||||
menu_height + (titlebar_height + max_height) / 2 + frame_width,
|
||||
Screen::the().width() - frame_width,
|
||||
Screen::the().width(),
|
||||
(max_height - titlebar_height) / 2 - frame_width);
|
||||
case WindowTileType::TopLeft:
|
||||
return Gfx::IntRect(0,
|
||||
|
@ -785,12 +785,12 @@ Gfx::IntRect Window::tiled_rect(WindowTileType tiled) const
|
|||
return Gfx::IntRect(0,
|
||||
menu_height + (titlebar_height + max_height) / 2 + frame_width,
|
||||
Screen::the().width() / 2 - frame_width,
|
||||
(max_height - titlebar_height) / 2);
|
||||
(max_height - titlebar_height) / 2 - frame_width);
|
||||
case WindowTileType::BottomRight:
|
||||
return Gfx::IntRect(Screen::the().width() / 2 + frame_width,
|
||||
menu_height + (titlebar_height + max_height) / 2 + frame_width,
|
||||
Screen::the().width() / 2 - frame_width,
|
||||
(max_height - titlebar_height) / 2);
|
||||
(max_height - titlebar_height) / 2 - frame_width);
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue