ScreenshotEffect: fix lookup of ComparableQPoint keys in QMap

QMap::value() failed to find existing keys when tow ComparablePoint
shared the same x but not the same y.

This commit improves the operator<() to fix that.
This commit is contained in:
Méven Car 2021-01-20 09:32:13 +01:00
parent 57086c341c
commit bd626d9565

View file

@ -48,7 +48,7 @@ public:
// utility class that allows using QMap to sort its keys when they are QPoint
// so that the bottom and right points are after the top left ones
bool operator<(const ComparableQPoint &other) const {
return x() < other.x() || y() < other.y();
return x() < other.x() || (x() == other.x() && y() < other.y());
}
};