I am looking for a way to adjust the page height based on the height of a Symbol. Key point is that the symbol scale percentage changes based on layout (e.g. 60% for iPad, 30% for mobile etc.)
My problem is that there is often a lot of empty space at the bottom of the page (after Content 2 in the file) as the Symbol shrinks itself to the size of the screen.
Is there any way to get the page height to be set based on the Symbol height (after adjusting for scaling)?
Does that answer your question? It looks like you would set a class name of 'dimensions' to the element you wish to set the boundaries of your Hype document.
I think we are getting closer because the code is definitely adjusting the page height!
However, it is not operating in a predictable way -- probably because of some errors in my implementation? I have not changed the code and am simply giving the Symbol the class "dimensions".
The primary page I am working on is 768*1300. Even though the Symbol dimension extends to the blue rectangle, when I publish it, the page stops at the red rectangle. Why?
Note the issue is not restricted to the copy but also on page one if you use the Preview Current Scene in Browser on it. Not a normal thing to do for scene one but may help in pointing to the culprit.
--
Update on my looking at it.
It looks like the HypeLayoutRequest event is not being called when you use Preview Current Scene in Browser
I can only guess the Preview Current Scene in Browser* is not taking into account a scene is a layout..?
Thanks for the extra investigation @MarkHunte! I've added this to the notes on the bug.
There is some specific code when doing a "Preview Current Scene in Browser" such that if you do have layouts it will make sure that layout gets shown regardless of the browser/window size so you're better able to preview it. In fact, the menu even changes to "Preview Current Layout in Browser" in this case. I'm guessing something we do to ensure the layout is interfering when there's only one but it is flexible. It wasn't evident at first glance though.
Yeah, I think we're short-cutting that code when you preview a specific layout.
I remember long ago having some discussion on if we should allow for a separate "preview current scene" from a "preview current layout", but it was decided that if you're using this functionality you probably what exactly whatever you're viewing to be what is displayed in the browser.
I'm guessing we have some sort of small bug where we're missing a little bit of code that's called through the normal path in the sizing. We may also want to go through a normal scene load path when there's not multiple layouts.
It's amazing how this is only now being noticed after all this time. I would have thought one of us would have stumbled across this before now but I guess most of us preview through the standard Preview and when using Preview current scene we are normally again not testing layouts per se.
Yeah - I think that justifies what we were doing was probably the correct tradeoff (minus the bug which was reported). There's always these cases where it is iffy to add certain UI complexity for a 100% solution when it probably won't be used much... And if it ends up it is needed, folks usually give us feedback and we can just add later!