Forums

Full Version: PreciseZoomControl
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed while zooming with the mousewheel, it either goes too deep or too far away.

To solve this issue, I butchered the ZoomControl, and made the following modifications:

private function onMouseWheel(event:MouseEvent) : void
{
var dw:Number = event.delta;
var dz:Number = dw < 0 ? 0.975 : 1.025;
Transforms.zoomBy(_object, dz);
}


it checks whether the event delta is positive or negative, then assigns dz according to that. one improvement could be based on delta substract or add it to one multiplied with a constant.

PrecisePanZoomControl is attached.

Best to all.
i'm new to development, so please bare with me...

if I want to implement this code, should I just copy and past with the main app or can I call on this function which might reside locally but not in the immediate file? what's good practice?
Reference URL's