How to change Draw Shape Position Base Origin Point

Discuss the drawing application
Post Reply
conor0722
Posts: 1
Joined: Sat Jun 16, 2018 3:21 pm

How to change Draw Shape Position Base Origin Point

Post by conor0722 »

I would like to understand how a can change a Shape (or objects) Position Base Point location from the apparent default of upper left corner to the center of the "object". There appears to be a way to change based on the nine major points, but I cannot determine how to "save" or maintain the modified origin. The end goal is to click on or select any object and get the X / Y coordinates of the object center to read in the Status Bar.
Illustration of desired goal
Illustration of desired goal
OpenOffice 4.5.1 on Windows 7
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to change Draw Shape Position Base Origin Point

Post by Zizi64 »

You can do it temporarly only and only on the Position and size panel (but not on the status bar.)
Base_point.png
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
jungle_mole
Posts: 1
Joined: Sun Aug 25, 2019 12:04 am

Re: How to change Draw Shape Position Base Origin Point

Post by jungle_mole »

well, that one renders whole Draw application completely useless for me
that's funny, how such a small ("small"?) feature ,or: lack thereof -- can make entire hundred thousands lines of code piece of software non existent to someone =)

luckily this thing was googled by people before me, so i've found this topic fast =)
Libreoffice 6.2 on windows 10 (but really, m$ office on win10)
Kari52
Posts: 10
Joined: Tue May 12, 2020 1:01 pm

Re: How to change Draw Shape Position Base Origin Point

Post by Kari52 »

This is realy a big shortage for me too. In circles the position point should be as default in the center, not outside the the circle.

Can user create his own components for example circle and square with position point in the center ?

If you want to draw circles inside each other (same origo) you have to but them in different positions to get them in same position. Very strange and difficult. I would say, stupid.

If it is impossible to modify center point, then there should be in the component library a cirle, square and rectangle where position point is in the center.
OpenOffice 4.1.6 On Windows 10
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to change Draw Shape Position Base Origin Point

Post by Zizi64 »

Use some macro routines to shift a shape by a half with/height of the boundary rectangle:

Code: Select all

Sub ShiftCenter2LeftTop
 Dim oDrawDoc as object
 Dim oShape, oSelection as object
 Dim oPos as New com.sun.star.awt.Point
 
	oDrawDoc = Thiscomponent
	oSelection = oDrawDoc.Currentselection
	if IsNull(oSelection) then
		MsgBox("There is not any shape selected. Please select a shape.",48,"Attention:")
		Exit Sub
	end if
	If (oSelection.Count > 1) or (oSelection.Count = 0) then 
		MsgBox("Please select one shape",48,"Attention:")
		Exit Sub
	end if
	oShape = oSelection(0)
	oPos = oShape.Position
	oPos.X = oPos.X - oShape.Boundrect.Width/2
	oPos.Y = oPos.Y - oShape.Boundrect.Height/2	
	oShape.Setposition(oPos)
End Sub




Sub ShiftLeftTop2Center
 Dim oDrawDoc as object
 Dim oShape, oSelection as object
 Dim oPos as New com.sun.star.awt.Point
 
	oDrawDoc = Thiscomponent
	oSelection = oDrawDoc.Currentselection
	if IsNull(oSelection) then
		MsgBox("There is not any shape selected. Please select a shape.",48,"Attention:")
		Exit Sub
	end if
	If (oSelection.Count > 1) or (oSelection.Count = 0) then 
		MsgBox("Please select one shape",48,"Attention:")
		Exit Sub
	end if
	oShape = oSelection(0)
	oPos = oShape.Position
	oPos.X = oPos.X + oShape.Boundrect.Width/2
	oPos.Y = oPos.Y + oShape.Boundrect.Height/2	
	oShape.Setposition(oPos)
End Sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to change Draw Shape Position Base Origin Point

Post by John_Ha »

conor0722 wrote:The end goal is to click on or select any object and get the X / Y coordinates of the object center to read in the Status Bar.
You are using the wrong software. Draw is not designed to be a CAD system, which is what you need. Draw is designed to produce "neat, pretty looking layouts" where dimensions, locations and absolute sizes are of little importance. See Chapter 10 - Advanced Draw Techniques which says
Drawing to scale
Draw is not a CAD (computer-aided design) program but a graphics program with which you can produce drawings to scale. The example used for this chapter is a drawing of a Logic Circuit Diagram.
Clipboard01.gif
Clipboard01.gif (4.7 KiB) Viewed 4505 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply