Scale proportional based on width


(Hans-Gerd Claßen) #1

scale proportional based on width -> overlapping height will be centered and cut off …
link
scaleProportionalBasedOnWidth.hype.zip (27.3 KB)


(Jonathan Deutsch) #2

To summarize what I’m seeing: this is like the Shrink to Fit option when the size ratio favors height, and Expand to Fill when the ratio favors width?

P.S. Good to see the getter/setter API being used for tasks like this!


(Jonathan Deutsch) #3

I was thinking about this a little more, I think this will achieve the same effect without code:

  1. Create an enclosing group
  2. Set that enclosing group to use top, left, right pins and is width sizeable
  3. Set the inner group to use top, left, right pins, width and height sizeable, and then is set to shrink to fit and zoom contents

scaleProportionalBasedOnWidth-flexible-only.hype.zip (47.1 KB)


(Hans-Gerd Claßen) #4

hello jonathan,

your example does not center the height … ¿ and it stops when docwidth is reached …
well, the original request was to use this setting within another fullwidth site.
always fill the full width and crop the height centered when needed …

after all: this won’t be a popular request :wink:

Hans