Bug 431466 - GeoPainter::regionFromRect() uses centerPosition argument as top-left point instead
Summary: GeoPainter::regionFromRect() uses centerPosition argument as top-left point i...
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-11 22:16 UTC by Johannes Zarl-Zierl
Modified: 2021-01-23 20:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Zarl-Zierl 2021-01-11 22:16:09 UTC
SUMMARY
GeoPainter::regionFromRect() is advertised as parameter-compatible with GeoPainter::drawRect(). However, the resulting region is not centered around the centerPoint, but rather uses it as top-left corner for the resulting QRegion.

STEPS TO REPRODUCE
1. Use drawRect to render a non-geoprojected rectangle
2. Use regionFromRect with the same parameters to create a QRegion
3. Draw the resulting region using drawRect in screen coordinates

OBSERVED RESULT
The rectangle rendered in step 3 is centered around the bottom-right corner of the rectangle rendered in step 1.

EXPECTED RESULT
Both rectangles should overlap around the same center.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-01-11 22:33:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/education/marble/-/merge_requests/38
Comment 2 Johannes Zarl-Zierl 2021-01-23 20:08:58 UTC
Git commit a8b9ffe0e615d5429ff079df2e63d85e27db158e by Johannes Zarl-Zierl.
Committed on 11/01/2021 at 22:26.
Pushed by rahn into branch 'master'.

Properly center GeoPainter::regionFromRect

M  +8    -7    src/lib/marble/GeoPainter.cpp

https://invent.kde.org/education/marble/commit/a8b9ffe0e615d5429ff079df2e63d85e27db158e