How to let a shape expand around its centerpoint when user drags corner handle

Started by Visisthebest, October 27, 2021, 08:19:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

Most shapes have a LocPinX and LocPinY in the center, rather than in one of the corners of the shape.

I would like to create the behavior that if a user drags the lower right corner to resize the shape, the resizing is actually happening on all sides equally around its center point. Is this something I can achieve with some ShapeSheet formulas?

Thank you for sharing your Visio insights!

(for context of what I do use already: I do protect the shape's Aspect Ratio, and I use ROUND() to set a minimum and maximum width and height for the shape, but the user should be able to resize freely within those bounds)
Visio 2021 Professional

Surrogate

Quote from: Visisthebest on October 27, 2021, 08:19:19 PM(for context of what I do use already: I do protect the shape's Aspect Ratio, and I use ROUND() to set a minimum and maximum width and height for the shape, but the user should be able to resize freely within those bounds)
you mean BOUND function ?

Surrogate

Few years ago we have in Russian forum interest thread about Limit the size of the shape (please read it via Google Translate).

Visisthebest

Thank you Surrogate that was typed mistakenly of course I mean the BOUND() function.

https://docs.microsoft.com/en-us/office/client-developer/visio/bound-function

This all works well limiting the size of Width and Height the user can set, but what I want to achieve is when the user resizes the shape the resizing is done equally around its centerpoint.

Said otherwise, the shape stays centered on its LocPinX and LocPinY while resizing. This would be really great if achievable with the shapesheet!
Visio 2021 Professional

Surrogate

Quote from: Visisthebest on October 28, 2021, 08:20:45 AMSaid otherwise, the shape stays centered on its LocPinX and LocPinY while resizing. This would be really great if achievable with the shapesheet!
LocPinX/LocPinY are depended on Width/Height. And in the formula you will get a cyclic reference !!!

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visisthebest

Good to know Surrogate so can't solve it that way.

Thank you Paul putting a GUARD() around the values in PinX and PinY produces exactly the resizing behavior I am looking for, amazing this shapesheet and what it can do!
Visio 2021 Professional

Paul Herber

Just bear in mind that that also stops the shape from being moved. Side-effect.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visisthebest

Yes I know, I lock this shape's PinX and PinY formula to the group shape's center so the user can still drag around the entire shape, best of all worlds.

Thank you Paul!
Visio 2021 Professional