Issue 113776 - Bezier curves are not smooth in editing view or image export
Summary: Bezier curves are not smooth in editing view or image export
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: editing (show other issues)
Version: OOO330m3
Hardware: PC All
: P3 Trivial with 1 vote (vote)
Target Milestone: OOo 3.3
Assignee: wolframgarten
QA Contact: issues@graphics
URL:
Keywords: needmoreinfo
Depends on: 107360 111021
Blocks: 111112
  Show dependency tree
 
Reported: 2010-08-10 15:53 UTC by Joe Smith
Modified: 2017-05-20 10:22 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
screen capture showing curve edit (99.12 KB, image/png)
2010-08-10 15:54 UTC, Joe Smith
no flags Details
screen capture showing curve edit with aa=on/off (28.12 KB, image/png)
2010-08-11 15:24 UTC, Joe Smith
no flags Details
bugdoc for reproducing the issue (8.59 KB, application/vnd.oasis.opendocument.graphics)
2010-08-12 16:30 UTC, hdu@apache.org
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Joe Smith 2010-08-10 15:53:26 UTC
Testing "OOo-dev 3.3  330m3(Build:9519)" on Fedora Linux 13

Steps to reproduce:

1) File > New > Drawing
2) Create a curved line (2 nodes is enough); adjust the handles to produce a
sharp curve.

See that the curve does not appear smooth, but as a series of straight lines.

Printing and export to PDF produce smooth lines; File > Export as image does not.

It seems that while moving the node handles, a smooth curve appears as a broken
line, then disappears when the handle is released (see attached screenshot).
Comment 1 Joe Smith 2010-08-10 15:54:07 UTC
Created attachment 71029 [details]
screen capture showing curve edit
Comment 2 wolframgarten 2010-08-11 08:10:19 UTC
Is this an original OOo build or from Fedora? What are your settings under
tool/options/view/Graphics output?
Comment 3 Joe Smith 2010-08-11 15:24:03 UTC
It's the latest snapshot from OO.org: OOO330_m3

> What are your settings under tool/options/view/Graphics output?

Bingo! It's the antialias setting:

  aa=off, curve is smooth

  aa=on, curve rendered as line segments

Screenshot attached.
Comment 4 Joe Smith 2010-08-11 15:24:56 UTC
Created attachment 71041 [details]
screen capture showing curve edit with aa=on/off
Comment 5 fyva 2010-08-11 15:53:58 UTC
This is a regression - in 3.2.1 this issue is not present.
Comment 6 wolframgarten 2010-08-12 08:59:57 UTC
Ok, thanks to jes for investigation. Only visible on direct display, not on a
VM. Reproducible. Reassigned.
Comment 7 Armin Le Grand 2010-08-12 15:34:51 UTC
AW: Does not happen on DEV300m83 on WIN. Which system is this done on and
reproduced...?
Comment 8 Armin Le Grand 2010-08-12 15:40:10 UTC
AW: Could reproduce on Linux on a DEV330m3. Seems to be Linux-specific. Only
happens with AA on, so it is a XRender-problem.
AW->HDU: Must have have to do with XRender graphics output under Linux. Please
have a look.
Comment 9 hdu@apache.org 2010-08-12 15:58:09 UTC
This problem is probably in the new method basegfx::tools::createLineTrapezoidFromB2DPolygon() 
introduced in issue 107360. It was activated for xrender targets in issue 111021, which got into 
DEV300_m83.
Comment 10 hdu@apache.org 2010-08-12 16:27:21 UTC
Yup, the polygon subdivision used in that method splits bezier segments into just ten line segments each 
regardless of the actual shape of the segments. For non-trivial segments this can change a smoothly 
rounded corner into edges that are almost orthogonal!
Comment 11 hdu@apache.org 2010-08-12 16:30:00 UTC
Created attachment 71057 [details]
bugdoc for reproducing the issue
Comment 12 hdu@apache.org 2010-08-12 16:38:43 UTC
I suggest to use the optimal split parameters provided by e.g.  B2DCubicBezier::getMaxDistancePositions() 
instead of using the split parameters 0.1, 0.2,..., 0.9 independently of the actual curve shape as the latter 
is geometrically  wrong especially for non-trivial curves.
Comment 13 hdu@apache.org 2010-08-13 08:14:17 UTC
Avoiding the current default subdivision in createLineTrapezoidFromB2DPolygon() solves this problem. 
Done in CWS ooo33gsl05.

Since the default subdivision having the problems outlined above is used all over place there probably will 
be related issues.
Comment 14 hdu@apache.org 2010-08-13 13:48:55 UTC
@wg: please verify in CWS ooo33gsl05
Comment 15 wolframgarten 2010-08-16 10:15:30 UTC
Verified in CWS.
Comment 16 Joe Smith 2010-08-23 16:44:37 UTC
Testing "OOo-dev 3.3  330m5(Build:9521)" on Fedora Linux 13:

Looks great: curve is smooth while editing, with aa ON or OFF.

Thanks!