[Solved?] Resizing multiple objects

Discuss the drawing application
Post Reply
lajosb
Posts: 8
Joined: Thu May 15, 2008 7:11 am

[Solved?] Resizing multiple objects

Post by lajosb »

I've been trying to find an answer to the following question in the online documentation and these forums, but thus far I've been unsuccessful unfortunately. Let me explain what I need.

I'm working on a map that has several icons on it. This map needs to be resized. That, of course, is no problem. However, I don't want to resize the icons. These icons have to stay in the same relative positions, but must not resize. Or, the other way around, after selecting everything, resizing that to the desired size, I want to resize the icons back to their original size, while keeping them in their new positions.

Now how do I do this? If I select these icons, Draw seems to treat the selection of multiple objects as a single object when it comes to size and position. However, I have a selection of multiple objects and want all of them to stay in the same place, but change all of their sizes at the same time.

In Powerpoint this would have been extremely easy, but please don't tell me that I have to go back to Microsoft... There must be a way to do this, without manually resizing all of these icons (on some maps there can be well over a hundred).


-edit-

Sorry, forgot to check the OTHER forums. This: http://www.oooforum.org/forum/viewtopic.phtml?t=54342 seems to work, but if anyone knows a more elegant solution, I'd be most grateful.
User avatar
Bhikkhu Pesala
Posts: 1253
Joined: Mon Oct 08, 2007 1:27 am

Re: [solved?] Resizing multiple objects

Post by Bhikkhu Pesala »

Maybe useful to post bryancole's code here too:

Code: Select all

Sub Main 
dim sz as new com.sun.star.awt.Size 
doc = ThisComponent 
sel = doc.CurrentSelection 
for i = 0 To sel.Count 
obj = sel.getByIndex(i) 
sz = obj.getSize() 
sz.Height = 4000 'set these to whatever you want 
sz.Width = 5000 
obj.setSize(sz) 
Next i 
End Sub
Idiot Compassion
LibreOffice 6.0.4 on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [solved?] Resizing multiple objects

Post by acknak »

In Powerpoint this would have been extremely easy...
I'm very curious. Could you elaborate a bit on how PPT would let you do it?

I also don't see how the macro code is going to help much, unless the icons are all exactly the same size.

It seems like what you really want is code that would scale the icons' positions but not the size. Then you could scale the map and the icon positions by the same factor and they should match.
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 32657
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [solved?] Resizing multiple objects

Post by Hagar Delest »

lajosb is right: draw several shapes in Powerpoint. Select them all and change their size:
- under Powerpoint -> position is kept
- under Impress -> relative position is kept

Personally, I like the Impress way because when I increase the size of shapes for example, under Powerpoint, they often overlap, so I've to move them whereas with Impress, the spacing is kept. Seems better for me.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [solved?] Resizing multiple objects

Post by acknak »

... draw several shapes in Powerpoint. Select them all and change their size:
- under Powerpoint -> position is kept...
So you mean that PPT scales the objects individually, not as a group--the size of each object changes, not their positions.

It would be handy to have that as an option, and I suppose you could use that as a solution here too.

I was focusing on an exact solution the problem, which (as I understand it) would require scaling the positions of the icons without changing their size.

If you use the PPT solution: scale everything together, then scale the icon size down again, you have to approximate the size, which is probably not critical, but also not exact.

These look like relevant issues to me:
Issue 29449: Resizing groups will resize elements of fixed size
Issue 64765: resize multiple objects simultaneously
You can register there and add your vote (up to two) or comment.
AOO4/LO5 • Linux • Fedora 23
User avatar
Hagar Delest
Moderator
Posts: 32657
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [solved?] Resizing multiple objects

Post by Hagar Delest »

acknak wrote:So you mean that PPT scales the objects individually, not as a group--the size of each object changes, not their positions.
Yes.
NB: I see now that this is indeed a missing feature in OOo since PPT has the same behavior as Impress if the objects are grouped.
acknak wrote:If you use the PPT solution: scale everything together, then scale the icon size down again, you have to approximate the size, which is probably not critical, but also not exact.
Seems so. Grouping all the objects for the first scale operation and ungroupping all of them for scale down.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply