Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions engine/src/stackview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,18 @@ void MCStack::view_update_transform(void)

// PM-2015-07-17: [[ Bug 13754 ]] Make sure stack does not disappear off screen when changing the scalefactor
MCRectangle t_bounded_rect, t_screen_rect;

// AL-2015-10-01: [[ Bug 16017 ]] Remember location of stacks on a second monitor
t_screen_rect = MCscreen -> getnearestdisplay(t_view_rect) -> viewport;

t_bounded_rect = MCU_bound_rect(t_view_rect, t_screen_rect . x, t_screen_rect . y, t_screen_rect . width, t_screen_rect . height);

const MCDisplay* t_nearest_display = MCscreen -> getnearestdisplay(t_view_rect);
if (t_nearest_display != NULL)
{
t_screen_rect = t_nearest_display -> viewport;
t_bounded_rect = MCU_bound_rect(t_view_rect, t_screen_rect . x, t_screen_rect . y, t_screen_rect . width, t_screen_rect . height);
}
else
{
// In noUI mode, we don't have a nearest display.
t_bounded_rect = MCU_bound_rect(t_view_rect, 0, 0, MCscreen -> getwidth(), MCscreen -> getheight());
}

// IM-2014-01-16: [[ StackScale ]] Update view rect if needed
view_setrect(t_bounded_rect);
Expand Down