71 views
in Embedded Wizard Studio by

Hi EW Team,
I was playing with my main application when I noticed a strange behavior. When I have a SlideTouchHandler (STH) with a defined SnapNext (ex : <90,0>)  and the STH is starting at offset 0, if I slide and release, the STH.Offset in x will be off by 9.

How can I fix this?

I created an example project linked with it.

https://ask.embedded-wizard.de/?qa=blob&qa_blobid=5229666179720057956

1 Answer

+1 vote
by
 
Best answer

Hello Velas,

the behavior is correct. The snap positions are calculated relative to the begin of the slide range determined by the properties MaxOffset .. MinOffset. In your case the slide range begins at 99999. Accordingly the first snap positions is 99999. The next is 99909. Then follow 99819, 99729, ... 99, 9, -81, -171, ... -99981. The last position is -99999 as it is the end of the slide range.

How can I fix this?

The start offset 0 is not modulo 90 within the range 99999 .. -99999. Either initialize the MaxOffset and MinOffset range with other values or ensure that Offset is a multiple of SnapNext relative to MaxOffset.

Alternative approach: initialize SnapFirst with <9,0>. This will result in the first snap position 99999, then 99990, the 99900, ... 90, 0, -90, -180, ... -99900, -99990, -99999.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...