[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.

REVISION SUMMARY
  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.

TEST PLAN
  Extended geopainter example app renders rectangles and ellipses as expected.

REPOSITORY
  rMARBLE Marble

BRANCH
  fixEllipseRectanglePainting

REVISION DETAIL
  https://phabricator.kde.org/D2141

AFFECTED FILES
  src/lib/marble/GeoPainter.cpp

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: kossebau, #marble, rahn, nienhueser
Cc: marble-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20160712/66ea74ff/attachment.html>


More information about the Marble-devel mailing list