PDA

View Full Version : 4.1.5 image onDrop x,y to Token.addToken x,y draw location miss match ?



bratch9
August 30th, 2021, 16:56
Not sure if this is a bug or a new feature for the changes of the image layers systems.

But the image onDrop callback x,y location no longer works as the Token.addToken x,y create location.

I've attached image.txt (lua) from core, and see token.jpg which shows that when dropping a token from assets, while the 'system' generated token ends up in the correct bottom right, the Token.addToken call using the provided ondrop x,y location ends up in the wrong location. ( Ive called it 'onDrop,Token.addToken' on the 'token.jpg' )

I'm not sure if this is a new bug due to the updates to the system, or if this is a new container scale factor that I should be taking into account.

If its a new scale factor, what is the correct function to call to get this value ?

At the moment a hardcoded 1.5 factor gets the tokens to the correct location. ( see commented out line 62 to enable the 1.5 scale factor. )

Thanks, Pete

bratch9
August 30th, 2021, 21:00
So I think I figured out what is causing the odd factor.

If I change my /scaleui from 150 to 100 it changes the factor that maps cursor drop location to token add location.

So I think this is a 'missing' math something happening due to the latest 4.1.5 code update failing to correct for UI scale value.

kevininrussia
August 31st, 2021, 02:34
I have /scaleui at 100. Running on 2 monitors both at 2560x1440.

Dropping token using Spell Tokens Extension on map is way off with the latest FGU build. Blue X is where the drop point is.

Ruleset 4e.

https://i.imgur.com/Fyg4uIc.png

superteddy57
August 31st, 2021, 10:20
Thank you for the report. I have passed this along to Moon to have a look.

Moon Wizard
September 1st, 2021, 06:04
Thanks for the report and details. To be honest, it looks like these APIs did not transition correctly to FGU (i.e. image control on-screen coordinates are not the same as image record data coordinates). However, I'll look at making the functions work as they did in v4.1.4 with the UI scale adjustments; as well as adding an Interface.getUIScale API.

Regards,
JPG

bratch9
September 1st, 2021, 10:15
At the moment I apply a ui scale factor ( from an add option control ) to the image onDrop and image onHoverUpdate which are the only functions I then pass data to Token coordinates. But I guess all the image callbacks should be checked and scaled.

Will we have access to interface.getUIScale quicker than v4.1.4 ui scale adjustment fixes ?

Thanks, Pete

nephranka
September 1st, 2021, 13:00
Thanks for the report and details. To be honest, it looks like these APIs did not transition correctly to FGU (i.e. image control on-screen coordinates are not the same as image record data coordinates). However, I'll look at making the functions work as they did in v4.1.4 with the UI scale adjustments; as well as adding an Interface.getUIScale API.

Regards,
JPG

Thank you!