Fix scaling for 'Draw From Triangle'

Bug #1589792 reported by su_v on 2016-06-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
su_v

Bug Description

The extension 'Render > Draw from Triangle' does not handle document scale correctly.

Steps to reproduce:
1) launch current trunk / 0.92pre
   (default prefs, default new doc (en_US locale))
2) draw a triangle with pen tool, keep it selected
3) open 'Extensions > Render > Draw From Triangle'
4) select '[x] Circumcircle' and hit 'Apply'

Expected result:
The circumcircle passes through all three corners of the triangle.

Actual result:
The circumcircle is drawn at incorrect position (offset from triangle) with incorrect size (in the above example based on the default template the drawn circle is too small).

The symptom is exposed with documents which have a document scale other than CSS pixel: the length of a SVG user unit in default templates in trunk / 0.92pre currently corresponds to 1 mm, and thus the reported issue is encountered in every new document based on the default template.

The attached patch partially reverts an earlier change (r13001) (the conversion is not needed AFAICT), and adjusts the unit identifier used in the triangle's properties report. It has been tested with new documents based on the default template (locale 'en_US'), and on the templates 'default pt', 'default px'. Please test and review the proposed changes.

Reported issue reproduced with Inkscape 0.92pre1 r14955 (latest trunk) on OS X 10.7.5.

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

Please note: The diff introduces a change in a translatable string (replaces hard-coded 'px' unit identifier with a variable). If this part of the proposed changes blocks inclusion in upcoming 0.92 due to the string freeze already in-place, a different solution could be to converted the reported sizes to CSS pixels - though within the context of the extension I'm not sure it would match user expectations better wrt lengths and area of the reported properties. Otherwise, please target to 0.93 (and consider mentioning the current state of the extension under 'Known issues' in the release notes).

jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP (32-bit), with Inkscape trunk rev. 14998.

Difficulties to test due to zeroDivision errors in some cases (reproduced with 0.48.5), and some rendering errors (only 2 points used to trace the circle instead of 3), quite rare with 0.48.5 but a lot more frequent with the trunk. Both points are not related to the patch IMHO, and should be investigated separately.

Changed in inkscape:
status: New → In Progress
assignee: nobody → jazzynico (jazzynico)
importance: Undecided → Medium
milestone: none → 0.92
jazzynico (jazzynico) wrote :

Give that the extension shows an erroneous circle, fixing it is much more important than having the strings fully translated IMHO (and size reporting is unset by default).

jazzynico (jazzynico) wrote :

Extension patched rev. 15000. (I kept that nice number for you ;))

Thanks ~suv!

Changed in inkscape:
assignee: jazzynico (jazzynico) → su_v (suv-lp)
milestone: 0.92 → none
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers