[Marble-devel] [Differential] [Request, 30 lines] D2141: Fix off-by-one/one positioning by GeoPainter::drawEllipse/Rectangle
kossebau (Friedrich W. H. Kossebau)
noreply at phabricator.kde.org
Tue Jul 12 03:37:43 UTC 2016
kossebau created this revision.
kossebau added reviewers: Marble, rahn, nienhueser.
GeoPainter::drawEllipse() & GeoPainter::drawRect() both take the
parameters width & height as qreal type, but if !isGeoProjected they do the
actual rendering calls using int based coordinates & sizes.
The old calculation would not compensate qreal->int rounding changes and often result
in a wrong 1 pixel offset in direction of topleft corner.
The respective GeoPainter::regionFromEllipse() and GeoPainter::regionFromRect()
also are adapted, with the first also being fixed to take also strokeWidth
into account for the topleft corner calculation, like done with the rect.
Extended geopainter example app renders rectangles and ellipses as expected.
To: kossebau, #marble, rahn, nienhueser
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Marble-devel