TransformGesture scaling image jitter in UI

Ask for help and post bugs.

TransformGesture scaling image jitter in UI

Postby tswalk » Tue Aug 08, 2017 12:23 am

I've been working around an issue where using TransformGesture with scaling uses the pivot of the RectTransform for the translation by calculating the average between the two touch points and adjusting the pivot on the begin of the TransformStarted event. This works, for the most part.

However, subsequent (two point) scaling events seem to cause a jitter or translation on the beginning and end of the event. I've also noticed that if I enable 'smoothing' on the Transformer, the affect is really erratic.

I cannot seem to figure out what is causing this offset... could it have anything to do with something that is being cached somewhere in TouchScript related to the pivot or center? I've been looking at it a few hours now, and can't quite put my finger on it yet.

I've attached a package without the libraries (using TouchScript 9.0 [import first, then package]), just import and open the scene 'layout_working_01'... then drill down in the hierarchy to the Image. Try running and using a two point touch scale around the letters "HD", then translate the image to the right and do another two point touch scale around the letters "ta"... notice the jitter?

I've also noticed that if I set the display to say 16:9, the very first scaling does not cause a jitter (guess this is because initially the image is centered due to its' size using aspect ratio fitter).. but if I switch the display (while retaining the HD ratio aspect) to say 4:3, the first and all subsequent translations get this jitter.

I enable/disable the scroll rect for good reason.. otherwise things get strange :)
Attachments
imagescaler_testing.7z
(70.64 KiB) Downloaded 61 times
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US

Re: TransformGesture scaling image jitter in UI

Postby valyard » Tue Aug 08, 2017 1:31 am

Hm.
Seems something to do with Screen Space UI. I will need to check.
I changed the Canvas to SS Camera: https://www.dropbox.com/s/lvk5pvtb2gbox ... 0.zip?dl=0

But why are you not using Translate of TransformGesture?
What behavior are you trying to achieve?
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: TransformGesture scaling image jitter in UI

Postby tswalk » Tue Aug 08, 2017 1:35 am

The ScrollRect was an easy way to permit boundaries on the view and also have elasticity when transforms during panning went beyond the image rect.
Last edited by tswalk on Tue Aug 08, 2017 2:52 am, edited 1 time in total.
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US

Re: TransformGesture scaling image jitter in UI

Postby tswalk » Tue Aug 08, 2017 2:50 am

valyard wrote:Hm.
Seems something to do with Screen Space UI. I will need to check.
I changed the Canvas to SS Camera: https://www.dropbox.com/s/lvk5pvtb2gbox ... 0.zip?dl=0

But why are you not using Translate of TransformGesture?
What behavior are you trying to achieve?


ok I see the difference with Translate and the canvas to SS Camera.. won't need to code the pivot change with it on. I think this was an effect of trying to use Translate with the canvas to SS overlay, and it not really doing anything except scaling based on center. So I though, ok... just code the pivot change for scaling to work like I thought it should (to center of touch points). Ya, more work than necessary obviously.
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US

Re: TransformGesture scaling image jitter in UI

Postby valyard » Tue Aug 08, 2017 3:52 am

Translate might be bugged with SS UI. I'll check.
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: TransformGesture scaling image jitter in UI

Postby valyard » Tue Aug 08, 2017 10:59 pm

valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: TransformGesture scaling image jitter in UI

Postby valyard » Tue Aug 08, 2017 11:10 pm

Updated package.
https://www.dropbox.com/s/706ne2k1ngs4t ... ckage?dl=0
Check SSUI scene. Some photos use ScreenSpaceTransformGesture which is more optimal.
valyard
Site Admin
 
Posts: 422
Joined: Mon Sep 08, 2014 11:57 pm

Re: TransformGesture scaling image jitter in UI

Postby tswalk » Wed Aug 09, 2017 8:53 am

ok, i'm seeing a bit of difference.. kinda late, so tomorrow I think i'll record what i'm experiencing and send to you to see. thanks valyard!
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US

Re: TransformGesture scaling image jitter in UI

Postby tswalk » Thu Aug 10, 2017 4:56 am

sent a PM with the video link
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US

Re: TransformGesture scaling image jitter in UI

Postby tswalk » Thu Aug 10, 2017 10:59 pm

so, went ahead with test build for iOS and in either case (changing canvas from overlay to camera) and using with or without the pivot changing method I created... things just don't work as expected. even the pivot point changing is way off, nothing like I see with it in the editor :(
User avatar
tswalk
 
Posts: 33
Joined: Sun Sep 20, 2015 6:37 am
Location: Texas, US


Return to Help and Bugs

Who is online

Users browsing this forum: No registered users and 1 guest