mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
WindowServer: Fix crash when initiating resize from a window edge.
This commit is contained in:
parent
b7ad35d040
commit
49f273c4ca
1 changed files with 2 additions and 4 deletions
|
@ -630,10 +630,8 @@ void WSWindowManager::start_window_resize(WSWindow& window, WSMouseEvent& event)
|
|||
ASSERT(outer_rect.contains(event.position()));
|
||||
int window_relative_x = event.x() - outer_rect.x();
|
||||
int window_relative_y = event.y() - outer_rect.y();
|
||||
int hot_area_row = window_relative_y / (outer_rect.height() / 3);
|
||||
int hot_area_column = window_relative_x / (outer_rect.width() / 3);
|
||||
ASSERT(hot_area_row >= 0 && hot_area_row <= 2);
|
||||
ASSERT(hot_area_column >= 0 && hot_area_column <= 2);
|
||||
int hot_area_row = min(2, window_relative_y / (outer_rect.height() / 3));
|
||||
int hot_area_column = min(2, window_relative_x / (outer_rect.width() / 3));
|
||||
m_resize_direction = direction_for_hot_area[hot_area_row][hot_area_column];
|
||||
if (m_resize_direction == ResizeDirection::None) {
|
||||
ASSERT(!m_resize_window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue