Bug 421082 - Copy paste bug in KisWindowLayoutResource.cpp
Summary: Copy paste bug in KisWindowLayoutResource.cpp
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (other bugs)
Version First Reported In: git master (please specify the git hash!)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Tiar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 20:39 UTC by Rafał Mikrut
Modified: 2021-08-23 08:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Mikrut 2020-05-05 20:39:06 UTC
```
            if (aRect.y() == bRect.y()) return aRect.x() < bRect.x();
            return (aRect.y() < aRect.y());
        });


```



https://invent.kde.org/kde/krita/-/blob/master/libs/ui/KisWindowLayoutResource.cpp#L212
Comment 1 Halla Rempt 2021-02-19 16:24:12 UTC
Sorry for the late reply, but I'm not completely sure I see the copy/paste error? The layout of the code is atrocious, but I think it does what it should do?
Comment 2 Tiar 2021-02-19 20:19:41 UTC
See the a/b prefixes; in the last line it checks "aRect.y() < aRect.y()" which is of course always false. It probably should be `b` in the second one, but it would be good to check in context.

Btw the line number is 200 now: https://invent.kde.org/graphics/krita/-/blob/master/libs/ui/KisWindowLayoutResource.cpp#L200
Comment 3 Tiar 2021-08-22 22:50:21 UTC
Git commit 77533803826b91afc573b9d249307391c4120902 by Agata Cacko.
Committed on 22/08/2021 at 22:49.
Pushed by tymond into branch 'master'.

Fix typo in WindowLayoutResource sort screens lambda

Before this commit, if the screens had different X values,
the return value would be always false because the lambda
checked aRect.y() < aRect.y() which can never be true since
it's the same value on both sides.

This commit fixes it by replacing one of them with bRect.y().
The direction is consistent with the previous line.

M  +1    -1    libs/ui/KisWindowLayoutResource.cpp

https://invent.kde.org/graphics/krita/commit/77533803826b91afc573b9d249307391c4120902
Comment 4 Halla Rempt 2021-08-23 08:57:41 UTC
Git commit 09637ff85051abb251df766a8c598691fe5464d1 by Halla Rempt, on behalf of Agata Cacko.
Committed on 23/08/2021 at 08:57.
Pushed by rempt into branch 'krita/5.0'.

Fix typo in WindowLayoutResource sort screens lambda

Before this commit, if the screens had different X values,
the return value would be always false because the lambda
checked aRect.y() < aRect.y() which can never be true since
it's the same value on both sides.

This commit fixes it by replacing one of them with bRect.y().
The direction is consistent with the previous line.
(cherry picked from commit 77533803826b91afc573b9d249307391c4120902)

M  +1    -1    libs/ui/KisWindowLayoutResource.cpp

https://invent.kde.org/graphics/krita/commit/09637ff85051abb251df766a8c598691fe5464d1