Bug 431466

Summary: GeoPainter::regionFromRect() uses centerPosition argument as top-left point instead
Product: [Applications] marble Reporter: Johannes Zarl-Zierl <johannes>
Component: generalAssignee: marble-bugs
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

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