matrix isScale and isRotation do not work
This seems to be a cosmetic bug but it's not:
https://bugs.launchpad.net/inkscape/+bug/415168
because the undo comment depends on 2geom matrix functions:
if (_current_relative_affine.isTranslation()) { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Move")); } else if (_current_relative_affine.isScale()) { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Scale")); } else if (_current_relative_affine.isRotation()) { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Rotate")); } else { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Skew")); }
and these are quite fundamental to Inkscape operation - if they are broken I'm afraid to think what else might be broken. Can someone with a good grasp of 2geom or just geometry please look into this? I think this must be fixed before the release.
bulia byak wrote, On 08/18/09 17:29:
This seems to be a cosmetic bug but it's not:
https://bugs.launchpad.net/inkscape/+bug/415168
because the undo comment depends on 2geom matrix functions:
if (_current_relative_affine.isTranslation()) { sp_document_done(sp_desktop_document(_desktop),
SP_VERB_CONTEXT_SELECT, _("Move")); } else if (_current_relative_affine.isScale()) { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Scale")); } else if (_current_relative_affine.isRotation()) { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Rotate")); } else { sp_document_done(sp_desktop_document(_desktop), SP_VERB_CONTEXT_SELECT, _("Skew")); }
and these are quite fundamental to Inkscape operation - if they are broken I'm afraid to think what else might be broken. Can someone with a good grasp of 2geom or just geometry please look into this? I think this must be fixed before the release.
the 2geom function are correct. But that _current_relative_affine variable does not hold the current relative affine. In function Inkscape::SelTrans::transform it is set to the absolute affine matrix.
Thomas
On Tue, Aug 18, 2009 at 1:31 PM, Thomas Holder<speleo3@...58...> wrote:
the 2geom function are correct. But that _current_relative_affine variable does not hold the current relative affine. In function Inkscape::SelTrans::transform it is set to the absolute affine matrix.
That's not quite it. For simple scaling, the difference between relative and absolute is just a translation. The only scale that isScale recognizes as such is scaling around 0,0, but at no point in seltrans do we have this value - it is always combined with some translation, be it "relative" or "absolute" in Inkscape::SelTrans::transform.
So, we need some way to recognize a combination of scale and translation as scale, of rotation and translation as rotation, etc. This used to work before 2geom conversion - the code was the same just calling libnr's is_scale() etc.
Very quick reply: 2geom has the method "bool Matrix::onlyScaleAndTranslation()" , is that what is needed?
ciao, Johan
-----Original Message----- From: bulia byak [mailto:buliabyak@...400...] Sent: dinsdag 18 augustus 2009 22:45 To: Thomas Holder Cc: Inkscape Devel List; lib2geom-devel@lists.sourceforge.net Subject: Re: [Lib2geom-devel] [Inkscape-devel] matrix isScale and isRotationdo not work
On Tue, Aug 18, 2009 at 1:31 PM, Thomas Holder<speleo3@...58...> wrote:
the 2geom function are correct. But that _current_relative_affine variable does not hold the current relative affine. In function Inkscape::SelTrans::transform it is set to the absolute
affine matrix.
That's not quite it. For simple scaling, the difference between relative and absolute is just a translation. The only scale that isScale recognizes as such is scaling around 0,0, but at no point in seltrans do we have this value - it is always combined with some translation, be it "relative" or "absolute" in Inkscape::SelTrans::transform.
So, we need some way to recognize a combination of scale and translation as scale, of rotation and translation as rotation, etc. This used to work before 2geom conversion - the code was the same just calling libnr's is_scale() etc.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Lib2geom-devel mailing list Lib2geom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lib2geom-devel
On Tue, Aug 18, 2009 at 6:10 PM, <J.B.C.Engelen@...1578...> wrote:
Very quick reply: 2geom has the method "bool Matrix::onlyScaleAndTranslation()" , is that what is needed?
Thanks, I will test it, but is there the same thing for rotation?
I see no similar method for rotation, but for now as a dirty workaround one could do:
matrix.without_translation().isRotation()
-----Original Message----- From: bulia byak [mailto:buliabyak@...400...] Sent: dinsdag 18 augustus 2009 23:18 To: Engelen, J.B.C. (Johan) Cc: speleo3@...58...; inkscape-devel@lists.sourceforge.net; lib2geom-devel@lists.sourceforge.net Subject: Re: [Lib2geom-devel] [Inkscape-devel] matrix isScale and isRotationdo not work
On Tue, Aug 18, 2009 at 6:10 PM, <J.B.C.Engelen@...1578...> wrote:
Very quick reply: 2geom has the method "bool Matrix::onlyScaleAndTranslation()" , is that what is needed?
Thanks, I will test it, but is there the same thing for rotation?
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
On Tue, Aug 18, 2009 at 6:30 PM, <J.B.C.Engelen@...1578...> wrote:
I see no similar method for rotation, but for now as a dirty workaround one could do:
matrix.without_translation().isRotation()
Thanks, without_translation did the trick for both rotation and scale, whereas onlyScaleAndTranslation() didn't work. I committed and closed the bug.
-----Original Message----- From: bulia byak [mailto:buliabyak@...400...] Sent: dinsdag 18 augustus 2009 22:45 To: Thomas Holder Cc: Inkscape Devel List; lib2geom-devel@lists.sourceforge.net Subject: Re: [Lib2geom-devel] [Inkscape-devel] matrix isScale and isRotationdo not work
This used to work before 2geom conversion - the code was the same just calling libnr's is_scale() etc.
This probably means I broke more stuff when changing to 2geom I guess... :-( I'm very sorry for it.
Ciao, Johan
participants (3)
-
unknown@example.com
-
bulia byak
-
Thomas Holder