# 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

edit retag close merge delete

Sort by » oldest newest most voted

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.

more

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!

( 2021-02-08 14:09:13 +0200 )edit

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).

( 2021-02-08 15:01:43 +0200 )edit

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!

( 2021-02-10 09:05:52 +0200 )edit

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.

( 2021-02-10 15:35:11 +0200 )edit

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!

( 2021-02-11 13:30:15 +0200 )edit

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: https://www.pitonyak.org/oo.php. Regard the table on that page.

( 2021-02-11 14:00:13 +0200 )edit

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!

( 2021-02-11 14:32:47 +0200 )edit

If only one object is selected, the edge/center of the object is aligned to the page margin/center (https://help.libreoffice.org/7.0/en-U...).

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

• 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 () to the left of the answer that solves your question.

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

more

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

( 2021-02-10 09:00:16 +0200 )edit

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

more