[pencil tool] dots are created with wrong cy value (GUI instead of SVG coordinate system)

Bug #597136 reported by su_v on 2010-06-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Johan Engelen

Bug Description

Dots created with the pencil (freehand) tool have a wrong cy value stored in the SVG source (verified in the XML Editor right after creation): cy is stored relative to the (ruler) origin of the GUI in the lower left corner of the page instead of relative to the SVG origin in the upper left corner of the page. The representation on on-canvas at creation time does not reflect the data stored in SVG notation.

Steps to reproduce:
1) create a dot with the pencil tool (Ctrl+click)
1a) alternatively use the pen tool in straight line mode (Ctrl+click)
2) duplicate the dot

Expected result:
The duplicate stays at the same x,y-position as the original.

Actual result:
The duplicate is moved to the mirrored y coordinate.

reproduced with Inkscape 0.47+devel r9515 on OS X 10.5.8
not reproduced with Inkscape 0.47 r22583

reported by Johan on irc (2010-06-21)

Johan Engelen (johanengelen) wrote :

For me, this fixes it:

=== modified file 'src/draw-context.cpp'
--- src/draw-context.cpp 2010-01-23 13:36:56 +0000
+++ src/draw-context.cpp 2010-06-22 21:58:53 +0000
@@ -837,7 +837,7 @@
     Inkscape::Preferences *prefs = Inkscape::Preferences::get();

     Geom::Matrix const i2d (sp_item_i2d_affine (item));
- Geom::Point pp = pt;
+ Geom::Point pp = pt * i2d.inverse();
     double rad = 0.5 * prefs->getDouble(tool_path + "/dot-size", 3.0);
     if (event_state & GDK_MOD1_MASK) {
         /* TODO: We vary the dot size between 0.5*rad and 1.5*rad, where rad is the dot size
@@ -856,7 +856,6 @@
     sp_repr_set_svg_double (repr, "sodipodi:rx", rad * stroke_width);
     sp_repr_set_svg_double (repr, "sodipodi:ry", rad * stroke_width);
- sp_item_set_item_transform(item, i2d.inverse());


Johan Engelen (johanengelen) wrote :

fixed in r9529

Changed in inkscape:
assignee: nobody → Johan Engelen (johanengelen)
milestone: none → 0.48
status: New → Fix Committed
su_v (suv-lp) wrote :

Changing status to 'Fix Released' in accordance to <http://wiki.inkscape.org/wiki/index.php/Bug_management#Bug_status> because the bug only existed in the development branch and not in the current stable release.

Changed in inkscape:
status: Fix Committed → Fix Released
ScislaC (scislac) wrote :

Misinterpretation on my part, sorry.

Changed in inkscape:
status: Fix Released → Fix Committed
status: Fix Committed → Fix Released
su_v (suv-lp) wrote :

Reopening - this error re-occurs in current trunk when
- duplicating a dot
- grouping a dot

I don't know what happened, but it seems as if the fix in revision 9529 is no longer effective somehow.

(tests with archived versions indicate that a change between 9944 and 9950 caused the regression:
- 9944: duplicating or grouping dots is still ok
- 9950: duplicated or grouped dots are transformed to mirrored y-position
possibly triggered by the changes in the C++-ification merge in revision 9946)

Reproduced with Inkscape 0.48+devel r10195 on OS X 10.5.8 (i386) and earlier revisions (up to 9950),
confirmed by ScislaC with current trunk on Ubuntu.

Changed in inkscape:
milestone: 0.48 → none
status: Fix Released → Confirmed
Changed in inkscape:
assignee: Johan Engelen (johanengelen) → nobody
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, trunk revision 11652.

Changed in inkscape:
importance: Undecided → Low
status: Confirmed → Triaged
jazzynico (jazzynico) wrote :

Apparently the change committed by Johan was overwritten by the c++ification (see http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/9946#src/draw-context.cpp).
I've tested the patch from comment #1 (with a minor change to fit the trunk), and it looks good, at least on Windows XP.

Attaching an updated version of the patch that works with revision 11652.

Changed in inkscape:
assignee: nobody → Johan Engelen (johanengelen)
status: Triaged → In Progress
jazzynico (jazzynico) wrote :
jazzynico (jazzynico) wrote :

Fix committed in the trunk , revision 11653.

Changed in inkscape:
status: In Progress → Fix Released
Kris (kris-degussem) on 2012-09-06
Changed in inkscape:
milestone: none → 0.49
jazzynico (jazzynico) wrote :

@Kris - The bug affected the trunk version only, not the released 0.48.x branch. In that case, we should not set a milestone.

Changed in inkscape:
milestone: 0.49 → none
Kris (kris-degussem) wrote :

@JazzyNico: indeed, I overlooked this one and did not remove the milestone of another one after I noticed it was fix released and not fix committed. Sorry ;-)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers