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();
|
||||
|
||||
std::sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
||||
if (a.coords.right <= b.coords.left && xo > 0) return true;
|
||||
if (a.coords.left >= b.coords.right && xo < 0) return true;
|
||||
if (a.coords.bottom <= b.coords.top && yo > 0) return true;
|
||||
if (a.coords.top >= b.coords.bottom && yo < 0) return true;
|
||||
return false;
|
||||
});
|
||||
if (xo != 0) {
|
||||
std::sort(_vp_redraw_regions.begin(), _vp_redraw_regions.end(), [&](const ViewportRedrawRegion &a, const ViewportRedrawRegion &b) {
|
||||
if (a.coords.right <= b.coords.left && xo > 0) return true;
|
||||
if (a.coords.left >= b.coords.right && xo < 0) return true;
|
||||
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()) {
|
||||
const Rect &rect = _vp_redraw_regions.back().coords;
|
||||
|
Reference in New Issue
Block a user