Windows Scaling

Hi everybody !

I tried to use the hypeGestureXPosition event even when the users Zoom upon a symbol !
To do that, I need to know what is the current scale factor applied on the window …

How can I collect this information in order to be able to make my coordinate transformation ?

Thank you very much for your wonderful Forum !

hm the window does not have a scaling-property. the document neither …

the document-body could have a scaling …

But i’d guess this is not what you are looking for. You might offer some more insight and at best a hypefile to illustrate your setup …

This an example : 20190906 Box.hype.zip (428.1 KB)

The rotation of the symbol works fine as long as the User don’t zoom the scene …

I hope to be able to make the coordinates transformation of the drag position according to the scaling done by the user ?

xxx.hype.zip (421.3 KB)

I’m not right sure of what you are trying to achieve.
the bouton has arange from zero to 180 degrees and the brownie turns 360 dergree? I scaled the window and got the same result …

… but had the impression that the approach you took is much to complicated.

my attached example should be draggable in the visual range.

if it does not solve your problem, please explain further :slight_smile:

Thank you for your help ! But it doesn’t solve my pb !-)
If you keep your file xxx.hype as an example :
It works fine if you let the screen at it’s initial size => the button rotate correctly the symbol’s wing
But if you zoom in the screen, with the trackpad, it becomes impossible to turn smoothly the button !
I understood it’s because the hypeGesturePosition events still give the coordinates in the initial size and don’t take into account the scale factor applied …
So, if the scene scaling by the trackpad is allowed, it is necessary to make a coordinate transposition of the gesture and to do that, I’m looking for a way to determine the current scaling factor ?
(I’m not sure to be clear, you would apologize my approximative english !-)

As soon as the scene is zoomed, the rotation becomes erratic !

drag_windowOffset.hype.zip (421.8 KB)

hypes gestureCoordinates can not be changed. so you’ve got to get getBoundingClientRects return to the same coordinatespace … please have a look if it fits your needs.

3 Likes

ROOOOOooooohhhhhhh ! It’s just … PERFECT !

Thank you so much for your help, Hans-Gerd : I was completely blocked with this since one week …
You saved my life !-)

I will implement that in my project
Have a good day !

2 Likes

:slight_smile: thx for response