An easy way to reset the transformation center (WAS: snap to guides: snap to center of an object)

Bug #170774 reported by Osgood
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Diederik van Lierop

Bug Description

It would be very nice if the snapping mechanism reacted
to the center of an object / group of selected object.
The current mechanism snaps only to the bounding box of
an object.

If we had this feature, a group of objects could be
centered on vertical axis with the Align and
Distributed dialog box, and the whole selection could
be then aligned with its center to a guide. This
feature would be very useful in practice.

Thanks!

Revision history for this message
Prokoudine (prokoudine) wrote :

Originator: NO

Diederik, do you mind if I assign this to you? :)

Revision history for this message
Dvlierop2 (dvlierop2) wrote :

Originator: NO

Of course I don't :-). You know that we can already snap to an object's
transformation center in recent builds, don't you? Otherwise have a look at
the "snap details" tab in the document properties. What is different here,
is that when you move a selection of objects, it will snap to the
transformation center of each individuals object. When they're grouped
however, only the group's transformation center will snap. Another thing
that's different is that this is not the real center, but I was already
planning to add that option one day also.

Ryan Lerch (ryanlerch)
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Triaged
Changed in inkscape:
assignee: dvlierop2 → mail-diedenrezi
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Inkscape already snaps to the rotation center, as I've explained before. The "real" center I discussed before would be ambiguous. How should that be defined? The middle of the bounding box? The center of gravity? For example. have a look at

http://en.wikipedia.org/wiki/Triangular#Points.2C_lines_and_circles_associated_with_a_triangle

Which of the five possible centers should we use?

Changed in inkscape:
status: Triaged → Invalid
Revision history for this message
LucaDC (lucadc) wrote :

I understand that there are different possibilities for defining the "real center" of a complex object, but most of the time you deal with squares, rectangles, circles, ellipses, stars, and so on... Given the simmetry of that kind of objects, all centers are the same.
I think that having [h/2, w/2] would be enough for now, at least better than nothing (ignoring rotation center that could have been moved). In the future you could add some options for more "advanced" users but I think it will always be difficoult to satisfy all geometric needs so let's start with the simplest solution.

By the way, is it possible to reset the rotation center to it's initial position (I mean the one after the object is created and before you change it the first time)? And how is this initial position defined? This could be the answer to where to start from.

Thanks for your work.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Well, that all makes sense indeed. I think it was Bulia's statement a long time ago that not everything must make sense mathematically, if it just works for the user then that should be sufficient.

For a rectangle/star/ellipse/arc the center is quite obvious, and for any other shape we'll use (h/2, w/2).

I'll implement this!

Changed in inkscape:
status: Invalid → Confirmed
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

About the resetting of the transformation center: that's currently only possible through the XML editor. Maybe we should make it resettable by double-clicking on it? I don't see any other straightforward way. But if we do it like that, shouldn't we then first warn the user with a dialogbox to prevent accidentally double-clicking?

Revision history for this message
LucaDC (lucadc) wrote :

I agree that double-clicking could be done accidentally and so I would suggest adding an "object right-button menu" entry like "Reset center". Of course a corresponding entry under the "Object" menu or the "Object -> Transform" panel should be added too.
Otherwise, a Ctrl-click (or Shift-Ctrl-click), as for the guides, could also do the job.

I prefer a solution that doesn't require selecting the current center as I've had problems with some older versions where the center happened to go very far from the object (after a transformation or copy-paste, I don't remember exctly now) and looking for it was very annoying (I had to select rotation, zoom out, find and bring the center nearly back, rezoom into the object and get the correct position).
The same is true for guides: having to Ctrl-click on each of them to delete is time-wasting. But this is another bug-tree...

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Snapping to/from an item's centre has been implemented as of revision #20536. We still need an easy way to reset the transformation center, so I will modify the title of the bug report to reflect this.

description: updated
description: updated
Revision history for this message
LucaDC (lucadc) wrote :

Bug #320489 is the reason for which I prefer not having to select the current center with the mouse to reset it.
I didn't notice that the copy-paste-center_moved problem was still present.
Again, I suggest the "(right-click on the object | 'Object' menu entry) -> 'Reset center' menu entry" solution.

Revision history for this message
KoRi (koen-ribus) wrote :

I think it would be useful to have a way to reset the center without the need to click on it i.e. the need to find it (shift-click on the center already resets it).
But it is not really a solution to the "copy-paste-center_moved" problem as the center of the copy should stay in the same place.
As stated in https://bugs.launchpad.net/bugs/320489 it seems to be only the case with rectangles and only (again?) since the changes in rev. 20243. (I'm still looking at it but could not (yet?) find the exact cause.)

Revision history for this message
megaohm (megaohm1) wrote :

"Snapping to/from an item's centre has been implemented as of revision #20536."

Where do I find this revision?

I need to snap to an objects center position. I would like to use Inkscape for control panel layout and design. I use a circle for the hole to be drilled in the my panels. I also enlarge this circle to represent the knob that will be placed there on the finished panel. Resizing throws off the desired position. I also need to make scales around the knobs and this would be much easier if the objects could align to center positions. Ideally I would like to use the X, Y fields to enter the exact placement of these objects.

I have used a workaround described in the forum (title: Placing objects relative to their center point question ). This works but is prone to error. Errors that I don't catch before I place the panel order will result in a couple hundred dollars down the drain for me.

I am using the Windows version.

Thanks,
p.

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : Re: [Bug 170774] Re: An easy way to reset the transformation center (WAS: snap to guides: snap to center of an object)

For development versions, please go to

http://www.inkscape.org/download/?lang=en

and look for the "Development versions" header. And be sure to let us
know what you think of it, especialy if you find any bugs!

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.