Fix: Crash if error message window is too wide for screen. (#10172)

This doesn't seem new, just easier to trigger with new scaling.
pull/461/head
PeterN 2 years ago committed by GitHub
parent 6ea3e7e487
commit c81c242c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -245,8 +245,8 @@ public:
pt.y = UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top;
pt.y = (pt.y < (_screen.height >> 1)) ? scr_bot - sm_height : scr_top;
} else {
pt.x = Clamp(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (sm_width / 2), 0, _screen.width - sm_width);
pt.y = Clamp(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (sm_height / 2), scr_top, scr_bot - sm_height);
pt.x = std::min(std::max(UnScaleByZoom(pt.x - vp->virtual_left, vp->zoom) + vp->left - (sm_width / 2), 0), _screen.width - sm_width);
pt.y = std::min(std::max(UnScaleByZoom(pt.y - vp->virtual_top, vp->zoom) + vp->top - (sm_height / 2), scr_top), scr_bot - sm_height);
}
return pt;
}

Loading…
Cancel
Save