Bug 297595

Summary: Curve editor does not use an optimal rasterisation algorithm; it produces extra pixels
Product: krita Reporter: Antoine <alecail>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Severity: minor CC: halla, lukast.dev
Priority: NOR    
Version: 2.4-snapshots   
Target Milestone: ---   
Platform: Ubuntu Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: A tetris piece in the curve after the rasterization step
Pixels are wiggling aroind the curve

Description Antoine 2012-04-06 13:47:59 UTC
Created attachment 70190 [details]
A tetris piece in the curve after the rasterization step

See attachement: This kind  of blob ( Tetris piece, or rookwise connected) should not happen.
Comment 1 Halla Rempt 2012-04-06 13:51:43 UTC
You can enable anti-aliasing for curves in the settings panel. It's a setting because some users didn't want the lines anti-aliased. We don't paint these lines ourselves, that's QPainter's work, so there's nothing much we can do about the aliased case.

Sorry, I'm going to have to close this one -- though there's certainly a case to be made for making AA the default, instead of aliased.
Comment 2 Halla Rempt 2012-04-06 13:53:51 UTC
Git commit dc97f77a474f609f80430e1a5d169fdc8c4b86af by Boudewijn Rempt.
Committed on 06/04/2012 at 15:53.
Pushed by rempt into branch 'master'.

Anti-alias the curves by default

Because it looks prettier :-)

M  +1    -1    krita/ui/kis_config.cc

Comment 3 Antoine 2012-04-06 14:03:27 UTC
Created attachment 70191 [details]
Pixels are wiggling aroind the curve
Comment 4 Antoine 2012-04-06 14:06:57 UTC
The anti-aliased curve does not look good either. I have never noticed this with QPainter's curve drawing algorithm. Something must happen after its job is done.
Comment 5 Halla Rempt 2012-04-06 14:10:31 UTC
hm, you're right. Weird stuff is happening here.
Comment 6 Halla Rempt 2012-04-06 14:14:09 UTC
Git commit b044df223dbcb801472d150bec8c070f10cc6216 by Boudewijn Rempt.
Committed on 06/04/2012 at 16:13.
Pushed by rempt into branch 'master'.

Let Qt draw the polyline

We used to draw lines ourselves, giving a bad result.

M  +5    -8    krita/ui/widgets/kis_curve_widget.cpp

Comment 7 Halla Rempt 2012-04-06 14:14:21 UTC
Can you check whether this is better for you?
Comment 8 LukasT 2012-04-09 19:44:09 UTC
I remember Dmitry made it aliased due to precision by default. It is precision vs look-good decision here, we change the defaults back-and-forth.
Comment 9 Halla Rempt 2012-04-09 19:53:07 UTC
I know... but this time I did something more: I also changed the painting algorithm and used QPainter to paint the path directly, instead of us painting line segment by line segment.