Add Function to Remove All Transforms

Bug #1384780 reported by Equis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Wishlist
Unassigned

Bug Description

I would like a function to remove all transforms on an object. A couple use cases:

- Text that has been stretched and needs to be restored to its original proportion
- Objects that are skewed or rotated and need to be restored to their original rotation
- Objects that are scaled or stretched and need to be restored to their original size and proportion.

This said, does the scaling and skewing of an object overwrite the original object's size/proportions or does it retain the original information in the file and apply the transform when writing to the screen?

su_v (suv-lp)
tags: added: transformations
Changed in inkscape:
importance: Undecided → Wishlist
Revision history for this message
Alvin Penner (apenner) wrote :

just for clarification, when you say "restored to its original proportion", are you referring to something like an Undo operation, where the shape actually reverts back to what it was, or are you referring to an operation that would remove all transform elements from an object and apply them directly to the object's coordinates without actually changing the current visual appearance of the object?

as for the question:
"does the scaling and skewing of an object overwrite the original object's size/proportions or does it retain the original information in the file and apply the transform when writing to the screen"
the answer is the second part, meaning the original object information is kept intact, and the transform is applied on top of the original like a second operation on top of the first, exactly the same as you did when you drew the object.

    <rect
       width="217.14285"
       height="94.285713"
       x="109.81639"
       y="225.67557"
       transform="matrix(0.96427403,-0.26490675,0.26490675,0.96427403,0,0)" />

an example, rotated rectangle. The rectangle will be drawn first without the transform element, and then later the transform will be applied.

Revision history for this message
Equis (rob-cummingsonline) wrote : Re: [Bug 1384780] Re: Wishlist: Remove All Transforms

I imagine reverting back to the original object. Not so much like an undo,
as it could be done in later sessions, but more like a revert to original
shape. In your example, it would remove the transform line, restoring the
original non-rotated rectangle.

If the transforms are applied one by one, it could be useful to remove each
transform individually. Say, remove a rotate but keep a skew.
On Oct 23, 2014 6:55 PM, "Alvin Penner" <email address hidden> wrote:

> just for clarification, when you say "restored to its original
> proportion", are you referring to something like an Undo operation,
> where the shape actually reverts back to what it was, or are you
> referring to an operation that would remove all transform elements from
> an object and apply them directly to the object's coordinates without
> actually changing the current visual appearance of the object?
>
> as for the question:
> "does the scaling and skewing of an object overwrite the original object's
> size/proportions or does it retain the original information in the file and
> apply the transform when writing to the screen"
> the answer is the second part, meaning the original object information is
> kept intact, and the transform is applied on top of the original like a
> second operation on top of the first, exactly the same as you did when you
> drew the object.
>
> <rect
> width="217.14285"
> height="94.285713"
> x="109.81639"
> y="225.67557"
>
> transform="matrix(0.96427403,-0.26490675,0.26490675,0.96427403,0,0)" />
>
> an example, rotated rectangle. The rectangle will be drawn first without
> the transform element, and then later the transform will be applied.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1384780
>
> Title:
> Wishlist: Remove All Transforms
>
> Status in Inkscape: A Vector Drawing Tool:
> New
>
> Bug description:
> I would like a function to remove all transforms on an object. A
> couple use cases:
>
> - Text that has been stretched and needs to be restored to its original
> proportion
> - Objects that are skewed or rotated and need to be restored to their
> original rotation
> - Objects that are scaled or stretched and need to be restored to their
> original size and proportion.
>
> This said, does the scaling and skewing of an object overwrite the
> original object's size/proportions or does it retain the original
> information in the file and apply the transform when writing to the
> screen?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1384780/+subscriptions
>

Revision history for this message
Alvin Penner (apenner) wrote : Re: Wishlist: Remove All Transforms

>> If the transforms are applied one by one, it could be useful to remove each
 transform individually

hmm, interesting...
I think the problem will be that currently when you apply more than one transform to the same object, then all information about the actual sequence of events is lost. The Undo history may have this information, but it will eventually be lost, and certainly the transform element does not have such information, it all gets merged into one accumulated matrix, so there is no way to disentangle the different operations

Revision history for this message
Equis (rob-cummingsonline) wrote : Re: [Bug 1384780] Re: Wishlist: Remove All Transforms

Well, either way. Can't tell you how many times I had to use an explicit
rotation so I could rotate it back when I needed to edit and align
something before applying the rotation again. Would be especially handy for
text.
On Oct 23, 2014 7:20 PM, "Alvin Penner" <email address hidden> wrote:

> >> If the transforms are applied one by one, it could be useful to remove
> each
> transform individually
>
> hmm, interesting...
> I think the problem will be that currently when you apply more than one
> transform to the same object, then all information about the actual
> sequence of events is lost. The Undo history may have this information, but
> it will eventually be lost, and certainly the transform element does not
> have such information, it all gets merged into one accumulated matrix, so
> there is no way to disentangle the different operations
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1384780
>
> Title:
> Wishlist: Remove All Transforms
>
> Status in Inkscape: A Vector Drawing Tool:
> New
>
> Bug description:
> I would like a function to remove all transforms on an object. A
> couple use cases:
>
> - Text that has been stretched and needs to be restored to its original
> proportion
> - Objects that are skewed or rotated and need to be restored to their
> original rotation
> - Objects that are scaled or stretched and need to be restored to their
> original size and proportion.
>
> This said, does the scaling and skewing of an object overwrite the
> original object's size/proportions or does it retain the original
> information in the file and apply the transform when writing to the
> screen?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1384780/+subscriptions
>

Revision history for this message
su_v (suv-lp) wrote : Re: Wishlist: Remove All Transforms

AFAIU the requested feature is not doable (the information for individual transforms not preserved), or would depend on earlier RFEs like
- Bug #171826 “view/edit current transform decomposed into rotation/scale/.”
- Bug #179309 “Add option to preserve scale/rotate/translate instead of converting to matrix()”
- Bug #421870 “Allow users to strip out Transform attributes with command”
and/or
- Bug #171327 “Save Undo/Redo History (integrate Revision control system) ”

There exists a verb (not linked to a menu command) which does delete the 'transform' attribute of the current selection, but the result is likely not was is requested here (AFAIU in part because transformations in SVG are relative to the SVG origin of the current viewport [1],[2]; in part because accumulated transforms stored as matrix() are optimized [3]).

[1] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Transforms.html#Transforms-Transform-Matrix
[2] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Glossary.html#transmatrix
[3] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Transforms.html#id1147906

Revision history for this message
Equis (rob-cummingsonline) wrote : Re: [Bug 1384780] Re: Wishlist: Remove All Transforms

Ah. It makes sense that the transforms are optimized into a single matrix.
So, it looks like it can't happen unless and until the transforms are saved
and not optimized.

On Thu, Oct 23, 2014 at 7:43 PM, ~suv <email address hidden> wrote:

> AFAIU the requested feature is not doable (the information for individual
> transforms not preserved), or would depend on earlier RFEs like
> - Bug #171826 “view/edit current transform decomposed into
> rotation/scale/.”
> - Bug #179309 “Add option to preserve scale/rotate/translate instead of
> converting to matrix()”
> - Bug #421870 “Allow users to strip out Transform attributes with command”
> and/or
> - Bug #171327 “Save Undo/Redo History (integrate Revision control system) ”
>
> There exists a verb (not linked to a menu command) which does delete the
> 'transform' attribute of the current selection, but the result is likely
> not was is requested here (AFAIU in part because transformations in SVG
> are relative to the SVG origin of the current viewport [1],[2]; in part
> because accumulated transforms stored as matrix() are optimized [3]).
>
> [1]
> http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Transforms.html#Transforms-Transform-Matrix
> [2] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Glossary.html#transmatrix
> [3] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Transforms.html#id1147906
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1384780
>
> Title:
> Wishlist: Remove All Transforms
>
> Status in Inkscape: A Vector Drawing Tool:
> New
>
> Bug description:
> I would like a function to remove all transforms on an object. A
> couple use cases:
>
> - Text that has been stretched and needs to be restored to its original
> proportion
> - Objects that are skewed or rotated and need to be restored to their
> original rotation
> - Objects that are scaled or stretched and need to be restored to their
> original size and proportion.
>
> This said, does the scaling and skewing of an object overwrite the
> original object's size/proportions or does it retain the original
> information in the file and apply the transform when writing to the
> screen?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1384780/+subscriptions
>

Revision history for this message
Formerly Kevin Yin, now disabled (kyin) wrote : Re: Wishlist: Remove All Transforms

You can do a trick to save transformations by doing clones of clones, and rotating/stretching/etc the intermediate clones.

Revision history for this message
Equis (rob-cummingsonline) wrote : Re: [Bug 1384780] Re: Wishlist: Remove All Transforms

That's a great trick! Thanks!

On Sun, Oct 26, 2014 at 1:58 AM, Kevin Yin <email address hidden>
wrote:

> You can do a trick to save transformations by doing clones of clones,
> and rotating/stretching/etc the intermediate clones.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1384780
>
> Title:
> Wishlist: Remove All Transforms
>
> Status in Inkscape: A Vector Drawing Tool:
> New
>
> Bug description:
> I would like a function to remove all transforms on an object. A
> couple use cases:
>
> - Text that has been stretched and needs to be restored to its original
> proportion
> - Objects that are skewed or rotated and need to be restored to their
> original rotation
> - Objects that are scaled or stretched and need to be restored to their
> original size and proportion.
>
> This said, does the scaling and skewing of an object overwrite the
> original object's size/proportions or does it retain the original
> information in the file and apply the transform when writing to the
> screen?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/inkscape/+bug/1384780/+subscriptions
>

su_v (suv-lp)
summary: - Wishlist: Remove All Transforms
+ Add Function to Remove All Transforms
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.