[patch] cosmetic fix for KPlotWidget

Jason Harris kstars at 30doradus.org
Wed Nov 28 00:28:59 GMT 2007


Hello,

The attached one-liner patch makes horizontal and vertical lines drawn in 
KPlotWidget much sharper, compare before[1] and after[2].

The issue: With antialiasing on, a line drawn with integer pixel values is 
regarded as being halfway between the bracketing pixels, so a line defined 
like:

	painter.drawLine( 1.0, 10.0, 1.0, 20.0 );

will look wide and fuzzy, whereas this line:

	painter.drawLine( 1.5, 10.0, 1.5, 20.0 );

looks narrow and sharp, because it doesn't "spill" into neighboring pixels.

The attached patch modifies the QPainter translate() coordinates by 0.5 
pixels, so that integer pixel values look sharp.

OK to commit? 

Jason

[1]: http://www.30doradus.org/kstars/kplottest_blurry.png
[2]: http://www.30doradus.org/kstars/kplottest_sharp.png

-- 
KStars: KDE Desktop Planetarium
kstars at 30doradus.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kplotwidget.patch
Type: text/x-diff
Size: 482 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071127/70927bdf/attachment.patch>


More information about the kde-core-devel mailing list