How to AlignVerticalCenter to selection area?

Discussion about writing code for Inkscape.
wyatt121
Posts: 18
Joined: Wed Jan 03, 2018 8:15 am

How to AlignVerticalCenter to selection area?

Postby wyatt121 » Fri Aug 31, 2018 9:27 am

Hi,

Using the Inkscape verb "AlignVerticalCenter" I'm able to easily align an object through the CLI. When I do this, the object is vertically centered to the page.

Within the Inkscape GUI Align and Distribute interface, there is a dropdown titled "Relative to".

I would like to be able to "AlignVerticalCenter" relative to the drop-down menu value "selection area". Unfortunately, there does not seem to be a verb to set this "Relative to" value.

Anybody know of a workaround?

Any help is much appreciated.

Regards,

Wyatt

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: How to AlignVerticalCenter to selection area?

Postby druban » Fri Aug 31, 2018 12:03 pm

Selection area is not a preserved dimension in vector drawing programs the menu item is deceptive. it used to just say "selection" which means the bounding box of all selected items no matter how big a selection marquee was used, and it still works that way even though the word 'area' has been added. not sure if a verb exists for the old one but if it does it would probably be the same Does that help or maybe you knew that already?
Your mind is what you think it is.

wyatt121
Posts: 18
Joined: Wed Jan 03, 2018 8:15 am

Re: How to AlignVerticalCenter to selection area?

Postby wyatt121 » Fri Aug 31, 2018 3:25 pm

I use it to vertically center text within a rectangle.

I select a rectangle, I select text. I choose "selection area", then press the align vertical center button and the text centers inside my box.

Is there a different way to vertically center text within a box automatically?

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to AlignVerticalCenter to selection area?

Postby Moini » Fri Aug 31, 2018 10:13 pm

I thought it used the setting that was last set in the dialog for the command line functionality. So that isn't the case?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

wyatt121
Posts: 18
Joined: Wed Jan 03, 2018 8:15 am

Re: How to AlignVerticalCenter to selection area?

Postby wyatt121 » Sat Sep 01, 2018 3:37 am

I can test this, but manually setting it in the GUI dialog doesn't really help my case, as I have some code actions that align by page, and require other code actions that need to be aligned by "selection area" within the same command line.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: How to AlignVerticalCenter to selection area?

Postby Moini » Sat Sep 01, 2018 10:10 am

Ah, okay. These commands (--verb) don't take any parameters currently.

If you're fluent in python, you could write an extension that makes use of Inkscape's simpletransform.py file, and can read data from a file... :-/
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “Programming”