matching VCL to touch screen coordinates

Noel Grandin noel at peralex.com
Mon Aug 12 04:01:33 PDT 2013


On 2013-08-11 19:47, Ptyl Dragon wrote:
>
> additionally, we are trying to get the zoom to be continuous, so to 
> follow a pinch gesture as native touch devices do. currently, i 
> believe zooming is done in integers, representing percentages. we need 
> to get it to work with float or double values, so to allow the

Zooming on mobile devices is tricky. To make it smooth, you will need to 
implement a mobile-specific strategy.

Typically, the way that zooming on mobile devices works is this
- when zooming, the UI enters a special ZOOMING state
- when zooming in, the zoom code asks the underlying code to render a 
bitmap target about twice the size of the current screen.
Then it uses the mobile device graphics framework, typically the 
on-board GPU , to rescale as need be.
- it typically does the rendering to bitmap from outside the main thread
- only when the zooming is over, does the zooming code tell the UI to 
resize properly to the new target size

This is why when zooming in or out slowly everything looks fine.
But when you zoom quickly, you sometimes see jagged lines for a while.
This is because the background did not have enough time to render a new 
target bitmap, so the zooming code is stuck with rescaling the old bitmap.

HTH, Noel.

Disclaimer: http://www.peralex.com/disclaimer.html




More information about the LibreOffice mailing list