Bug 1312302

Summary: Strange loss of drawing precision when drawing circles
Product: [Fedora] Fedora Reporter: Maurizio Paolini <paolini>
Component: kigAssignee: Than Ngo <than>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 23CC: jreznik, rdieter, rnovacek, than
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-24 20:28:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
kig file with a simple construction
none
two tangent circles none

Description Maurizio Paolini 2016-02-26 11:08:14 UTC
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):
kig-15.12.2-2.fc23.i686


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 18:17:33 UTC
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 21:08:17 UTC
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 21:12:38 UTC
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 13:58:53 UTC
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 22:45:17 UTC
Solved upstream
https://git.reviewboard.kde.org/r/127354/

Comment 6 Fedora End Of Life 2016-11-24 15:46:50 UTC
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 20:27:14 UTC
The problem is no longer present in Fedora 24