Viewport: Fix scroll region sort comparison not meeting strict weak ordering
fa90b567
was not a proper fix
This commit is contained in:
@@ -555,13 +555,26 @@ static void DoSetViewportPosition(Window *w, const int left, const int top, cons
|
|||||||
|
|
||||||
if (_networking) NetworkUndrawChatMessage();
|
if (_networking) NetworkUndrawChatMessage();
|
||||||
|
|
||||||
std::sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
if (xo != 0) {
|
||||||
if (a.coords.right <= b.coords.left && xo > 0) return true;
|
std::sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
||||||
if (a.coords.left >= b.coords.right && xo < 0) return true;
|
if (a.coords.right <= b.coords.left && xo > 0) return true;
|
||||||
if (a.coords.bottom <= b.coords.top && yo > 0) return true;
|
if (a.coords.left >= b.coords.right && xo < 0) return true;
|
||||||
if (a.coords.top >= b.coords.bottom && yo < 0) return true;
|
return false;
|
||||||
return false;
|
});
|
||||||
});
|
if (yo != 0) {
|
||||||
|
std::stable_sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
||||||
|
if (a.coords.bottom <= b.coords.top && yo > 0) return true;
|
||||||
|
if (a.coords.top >= b.coords.bottom && yo < 0) return true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
std::sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
||||||
|
if (a.coords.bottom <= b.coords.top && yo > 0) return true;
|
||||||
|
if (a.coords.top >= b.coords.bottom && yo < 0) return true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
while (!_vp_redraw_regions.empty()) {
|
while (!_vp_redraw_regions.empty()) {
|
||||||
const Rect &rect = _vp_redraw_regions.back().coords;
|
const Rect &rect = _vp_redraw_regions.back().coords;
|
||||||
|
Reference in New Issue
Block a user