Zoom Container : zoom is centered on the element (perspective)

Hi,
In an embedded view I have an element1 that I call from a zoom view.
for zoom I use CSS scale properties and transform x,y
the question is how to know if the zoom is centered on the element to display it or not if for example I have a zoom of 160%
I have access to the following property:
pageXY, screenXY, scale, element1 XY, horizontal and vertical offset X/Y when zoomed
image

plz label this post as perspective :slight_smile:

What is your goal for the zoom?

Could you show an example and usecase?
Are you trying to pan and zoom on a whole view with mouse events? (terrible performance if you do this in jython)
Or only on some specific targets after a button press? (why not just create a popup)

I have an embedded view with several zones, and I want when I zoom into zone 1 for example to display the elements of this zone

You do this by clicking on Z1 ?
You should just open a new page with only Z1 in it

I can display elements for example if the scale is 2 but, except that this implies that all the elements of all the zones will be visible.
Not with the click on zone 1, but rather with the wheel and play with the scale and xy of the page

Your browser has a build in zoom function (ctrl+ wheel) , does this not do what you want?

image

no I don't use that, I added css for the zoom only on the embedded view

Trying to recreate a smooth frontend animation/zoom/panning in perspective with jython scripts is not good. the performance is going to be terrible because every move event has to go back and forth to the gateway, since very script runs on the gateway.

Just adding a single fixed style zoom:200% is fine if that is what you want, but the centering and stuff should be done manualy with the scroll bars.
Or you could try to trigger a compenent.focus() event, that usualy does bring you near it.

1 Like

It can only be done smoothly with JS, or by creating a custom perspective module.
Someone made one that might be interesting for you.

3 Likes

in all cases it's just css I don't do anything in jython, thank you for your help

No no no you are changing CSS with jython/expressions. (almost) Everything done in perspective goes through the gateway.
This is not performant enough for any sort of frontend animations/zoom/motions.

Use it sparingly! Do not change the css zoom (or any css) in small increments every time the user scrolls or moves his mouse.

1 Like