How to align shapes in the Draw app?

There are two rectangles on the Draw sheet. Coordinates of the first (2.0; 2.0), the second (5.0; 6.0). The first one needs to be aligned with the second rectangle. Variant #1. I select the first rectangle (click), then the second (Shift + click) and the command Shape → Aligning Objects → Left. Result: alignment is done to the first rectangle (2.0; 2.0). Variant #2. I select the second rectangle (click), then the first one (Shift + click) and the command Shape → Aligning Objects → Left. Result: again alignment is done according to the first rectangle (2.0; 2.0). How do I get the desired result?
Version: 7.1.0.3 (x64) / LibreOffice Community
Build ID: f6099ecf3d29644b5008cc8f48f42f4a40986e4c
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded

If only one object is selected, the edge/center of the object is aligned to the page margin/center (Aligning (Objects)).

If more than one object is selected, they are aligned with respect to the selection edges/center.

Answering your question:

  • Select the object/s to be aligned
  • Move it/them to the right while holding Shift, passing the left margin of the reference object
  • Add the reference object to the selection
  • Align left

Tested with LibreOffice 6.4.7.2/7.0.4.2/7.1.0.3 (x86); OS: Windows 6.1.


Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.

Check the mark (Answer markCorrect answer mark) to the left of the answer that solves your question.

If the answer helped you, you can mark the up arrow (Upvote mark) that is on the left (to vote, you need to have karma of at least 5).

1 Like

It works. But still, I want it without unnecessary movements. Thanks! Best regards!

Thank you for such helpful advice. In some cases, this method will be quite useful! Best Regards!

1 Like

It is a little arbitrary how objects are aligned, in my test the smaller object was moved to align with the larger regardless of which was created first. There are two possible answers:

  1. Turn on Snap to objects, turn on Helplines. Using the mouse move the desired object using the helplines to align it with the other object (it should snap when it is close to the edges) and the ghost of the object that you are moving

  1. Right-click the object that you want to remain stationary, click Position and Size > Position and Size > Protect > Position then align objects. The other object(s) will align to the protected one.

Cheers, Al

Thanks for the help! These actions are good as an alternative. But I was hoping to use the Shape → Aligning Objects command. I was hoping to quickly align the shapes using this command. Is this feature not working? Or am I misunderstanding this function? Best regards!

From my experience:

-1- The alignments Left, Right, Top, Bottom always are done “to the extreme” regarding the common area of the selection (what would be the area of the group, grouping assumed).
-2- Alignment by first (left/right) or second (top bottom) Center is related to the respective middle of the pseudo-group-area.
-3- There are shapes (sectors!) for which the visible area is different from the overall-area. The overall area is relevant then when aligning though user may expect otherwise.

If you don’t get what you want this way, some handicraft may be required.

1 Like

Thanks for the help! The behavior of the Aligning Objects function described by you differs from the usual (for me) in the products of other developers. For example, this is the first time I’ve seen this. Perhaps there is some convenience hidden in this behavior, which I do not yet understand. But, along with the functionality that you described, I would like to have the usual (such, for example, as in Microsoft products). At least for simple shapes. Is it possible to add such functionality? Otherwise, … I don’t know what to do. I need a convenient editor, and Draw editor suits me very well. Best regards!

I don’t know those other products you’re talking of. To a very small amount I’m using the annotation tools of Foxit Reader. The annotations created there behave like TextBox shapes in Draw concerning the left/right/top/bottom alignment options. “Center” isn’t offered. Two additional options (horizontal/vertical) align with respect to the last selected annotation.
Enhancement requests go to bugs.documentfoundation.org.
If you are fond of programming user tools, this may be a task of limited complexity. However: Multiselections of shapes are sequences without a specified order as treated by the API. In specific the shapes are not sorted regarding the order they were selected in (by clicking).

  1. I apologize to everyone. I was delusional about the behavior of this feature, including in Microsoft applications.
  2. For a long time I had to work in an application in which the alignment behavior is based on the principle of “align the selected shapes to the last” (and not relative to the common area).
    Perhaps this led to a collision in my memory :). Aligning to the borders of the last shape is very convenient. After all, the purpose of alignment (mainly) is to change the position of the figures relative to each other, and not the general pseudo group.
  3. It is worth noting that for the Equal width / height command, the order affects the result. Why not do the same for alignment.

Best regards!

Quoting @Frants: “Why not do the same for alignment.”
I neither know the why nor if/when/by_whom the topic was discussed and decided.
Enhancement requests go to bugs.documentfoundation.org.
If the functionality is essential to your workflow: It isn’t really difficult to program a customized adjustment procedure for a group of selected shapes.
The one rather ticklish thing I already mentioned: There isn’t specified an order concerning the elements of a multiselection. You will therefore need to either align regarding the previous position (along with the bottom selected object e.g.) or to select the group and the preferred object in two steps.

Thanks you! This topic … is probably too small to discuss. There is a function, and great. Programming? I like this idea. There is one difficulty. How do you learn to do this (where to start)? Best regards!

Oh my… It depends. And: I’m not a developer. There are riches in the API (and of course in the core code) I have no idea of - and shortcomings I have an idea of. “Just for fun” I’m sometimes addressing a task by means of custom code. A life without any programming may come out a bit dry after all. It’s like with motorbiking.
If much interested in personalized advice you may call me. Flip 212145477194 and prefix the plus for the purpose. (Unfortunatly I don’t speak any foreign language but English, and my teachers [1950es] would laugh out loudly regarding this claim.)
There are the famous texts by Andrew Pitonyak, of course. You find them here: www.pitonyak.org/oo.php. Regard the table on that page.

You are very kind, thanks for your assistance! Perhaps I will not abuse your time and patience here, I will read something publicly available on the topic of programming in LibO. I think the topic is closed. Best regards!

Since there was a recent post into this old thread:
Assuming you have 12 shapes you want to align left where one of them shall be the “main shape” defining the left position.

  1. Draw a selection frame around all of those shapes.
  2. Unselect the “main” shape with Shift+Click.
  3. Drage the interim group of the 11 other shapes to the right till they all are “righter” than the main shape.
  4. Add the main shape to the selection (Shift+Click again).
  5. Align Left using the context menu.

Doing it is really much simpler than reading the instruction above…

1 Like

Thank you! I liked your advice, it will come in handy in my work.
Best Regards!

Can multiple answers be marked as “Solution”? For example, the answers of the authors Lupp and LeroyG helped me. Each of the answers offers an alternative solution, correct in its own way. Can’t two authors offer a “Solution”? Something is wrong here…

I too was looking at aligning objects to the principle/main object. In (old) CorelDraw, the main object is the first one selected and the following objects selected are aligned to that.
Simpler than protecting the position of the main object first.

Thank you! I like this way. Unfortunately, this is not the case everywhere.
Best Regards!