Skip to content

Commit 0b55480

Browse files
committed
Apply top and left margin correctly
1 parent 28b41ce commit 0b55480

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

engine/src/desktop-stack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ MCRectangle MCStack::view_platform_getwindowrect() const
233233
MCscreen->platform_getwindowgeometry(window, t_content_rect);
234234
// the content rect of a window should always be contained (or equal) to the frame rect
235235
// so compute these 4 margins and then apply them to the rect of the stack
236-
t_diff_rect.x = rect.x + (t_content_rect.x - t_frame_rect.x);
237-
t_diff_rect.y = rect.y + (t_content_rect.y - t_frame_rect.y);
236+
t_diff_rect.x = rect.x - (t_content_rect.x - t_frame_rect.x);
237+
t_diff_rect.y = rect.y - (t_content_rect.y - t_frame_rect.y);
238238
t_diff_rect.width = rect.width + (t_frame_rect.width - t_content_rect.width);
239239
t_diff_rect.height = rect.height + (t_frame_rect.height - t_content_rect.height);
240240
return t_diff_rect;

engine/src/lnxstack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ MCRectangle MCStack::view_device_getwindowrect(void) const
498498
MCscreen->platform_getwindowgeometry(window, t_content_rect);
499499
// the content rect of a window should always be contained (or equal) to the frame rect
500500
// so compute these 4 margins and then apply them to the rect of the stack
501-
t_diff_rect.x = rect.x + (t_content_rect.x - t_frame_rect.x);
502-
t_diff_rect.y = rect.y + (t_content_rect.y - t_frame_rect.y);
501+
t_diff_rect.x = rect.x - (t_content_rect.x - t_frame_rect.x);
502+
t_diff_rect.y = rect.y - (t_content_rect.y - t_frame_rect.y);
503503
t_diff_rect.width = rect.width + (t_frame_rect.width - t_content_rect.width);
504504
t_diff_rect.height = rect.height + (t_frame_rect.height - t_content_rect.height);
505505
return t_diff_rect;

engine/src/w32stack.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ MCRectangle MCStack::view_platform_getwindowrect() const
499499
MCscreen->platform_getwindowgeometry((HWND)window->handle.window, t_content_rect);
500500
// the content rect of a window should always be contained (or equal) to the frame rect
501501
// so compute these 4 margins and then apply them to the rect of the stack
502-
t_diff_rect.x = rect.x + (t_content_rect.x - t_frame_rect.x);
503-
t_diff_rect.y = rect.y + (t_content_rect.y - t_frame_rect.y);
502+
t_diff_rect.x = rect.x - (t_content_rect.x - t_frame_rect.x);
503+
t_diff_rect.y = rect.y - (t_content_rect.y - t_frame_rect.y);
504504
t_diff_rect.width = rect.width + (t_frame_rect.width - t_content_rect.width);
505505
t_diff_rect.height = rect.height + (t_frame_rect.height - t_content_rect.height);
506506
return t_diff_rect;

0 commit comments

Comments
 (0)