From bd626d9565ac6d361e0923e63596f5538ffb7a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Wed, 20 Jan 2021 09:32:13 +0100 Subject: [PATCH] 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. --- effects/screenshot/screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index bbb6ca3a19..eb715f8dcf 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -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()); } };