Bug 1312302 - Strange loss of drawing precision when drawing circles
Strange loss of drawing precision when drawing circles
Product: Fedora
Classification: Fedora
Component: kig (Show other bugs)
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: Ngo Than
Fedora Extras Quality Assurance
: Patch
Depends On:
  Show dependency treegraph
Reported: 2016-02-26 06:08 EST by Maurizio Paolini
Modified: 2016-11-24 15:28 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-11-24 15:28:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
kig file with a simple construction (1.67 KB, application/xml)
2016-02-26 06:08 EST, Maurizio Paolini
no flags Details
two tangent circles (6.03 KB, application/xml)
2016-03-05 16:08 EST, Maurizio Paolini
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
KDE Software Compilation 359805 None None None 2016-02-26 06:08 EST

  None (edit)
Description Maurizio Paolini 2016-02-26 06:08:14 EST
Created attachment 1130822 [details]
kig file with a simple construction

Description of problem:

In many cases the graphic drawing presents strange precision loss, like circles that should go through the same point but they don't.  Numerical error does not explain the result.
In the attached kig construction an arc and a circle are constructed such that
the circle is the support circle of the arc.  They should be exactly superposed, but they aren't (zoom in an area of size approximately 1)
Please note that:
- if exported in png format the precision error is present
- if exported in SVG (or other vector formats) the result is instead CORRECT!
This suggests that the problem is not in the kig "calc" engine, but somewhere else.

In my opinion this problems was not present in earlier kig versions (say kde2 or kde3), but it is there since quite some time.

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Download the attached "bug.kig"
2. Zoom around an end-point of the arc (near the origin) such that the window size is of order one

Actual results:
The arc (thick line) is separated from the circle (thin line)

Expected results:
The arc should be perfectly superposed with the circle

Additional info:
Numerical precision cannot be blamed, this example is not that extreme!

Note that the same problem is present upstream after building from the latest
git sources.  I opened the bug also upstream: https://bugs.kde.org/show_bug.cgi?id=359805
however it might be appropriate to also open a specific report for the fedora distribution (the one that I use).
Comment 1 Maurizio Paolini 2016-03-05 13:17:33 EST
There is a particularly simple workaround: comment out the method CircleImp::draw in objects/circle_imp.cc and objects/circle_imp.h forcing kig to draw circles as conics (which is actually the same used for generic curves).

This seems to imply that the problem with circles is in QT rather than kig
Comment 2 Maurizio Paolini 2016-03-05 16:08 EST
Created attachment 1133386 [details]
two tangent circles

The previous attachment (obsoleted) was probably not relevant to the problem.
The "steps to reproduce" in the bug description referred to that kig file
and are no longer valid.  The present example is more selfexplanatory
Comment 3 Maurizio Paolini 2016-03-05 16:12:38 EST
Digging further it seems that the problem disappears by using QrectF in place of QRect.  Note that this implies the creation of methods toScreenF alongside toScreen to produce a QPointF and a QRectF.

I am not receiving feedback from upstream...
Comment 4 Rex Dieter 2016-03-10 08:58:53 EST
Give David (to whom the upstream bug is assigned) more time to respond, it's been less that a week.
Comment 5 Maurizio Paolini 2016-03-22 18:45:17 EDT
Solved upstream
Comment 6 Fedora End Of Life 2016-11-24 10:46:50 EST
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 7 Maurizio Paolini 2016-11-24 15:27:14 EST
The problem is no longer present in Fedora 24

Note You need to log in before you can comment on or make changes to this bug.