Layout of my object handles canvas
<mx:Canvas width="{mainContainer.width}" height="{mainContainer.height}" id="mainCanvas" clipContent="false" >
<canvas:ObjectHandlesCanvas top="200" left="200" clipContent="false" id="oh" >
<grid:Grid left="0" top="0" id="grid" />
</canvas:ObjectHandlesCanvas>
</mx:Canvas>
In response to the zoom changing:
private function zoomChanged(e:ZoomChangeEvent):void
{
view.parent.scaleX = propertiesModel.zoomLevel * 0.2;
view.parent.scaleY = propertiesModel.zoomLevel * 0.2;
for(var i:uint = 1; i < view.objectHandles.modelList.length; i++)
{
view.objectHandles.redrawHandle(view.objectHandles.modelList[i]);
}
}
Change your sprite handle to compensate for zoom level.
public function redraw() : void
{
var zint:int = 0;
if(PropsModel.getInstance() != null)
{
zint = PropsModel.getInstance().zoomLevel - PropsModel.getInstance().defaultZoomLevel;
}
graphics.clear();
if( isOver )
{
graphics.lineStyle(1,0x508df4);
graphics.beginFill(0xc5ffc0 ,1);
}
else
{
graphics.lineStyle(1,0x508df4);
graphics.beginFill(0xFFFFFF,1);
}
graphics.drawRect(-5 - (-zint * 0.25),-5 - (-zint * 0.25),10+ (-zint * 0.6),10+ (-zint * 0.6));
graphics.endFill();
}
--
You received this message because you are subscribed to the Google Groups "Flex ObjectHandles" group.
To post to this group, send email to object...@googlegroups.com.
To unsubscribe from this group, send email to objecthandle...@googlegroups.com.
Visit this group at http://groups.google.com/group/objecthandles?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.