Scale error | Precision problems width, height, getbounds | ActionScript 3.0 AS3

##Precision Pitfalls Between getRect and Width/Height##
Keep in mind when you are using
var boundingBox:Rectangle = mc.getRect(coordSystem)
or
var boundingBox:Rectangle = mc.getBounds(coordSystem)
the Rectangle returned will be of a greater precision than mc.x, mc.y, mc.width and mc.height
trace (mc.width == boundingBox.width)
will often return false.
Also keep in mind that getRect and getBounds also can return different results depending on the contents of the DisplayObject.
getBounds returns a rectangle that defines the area of the display object including lines and shapes
getRect returns the rectangle including the extra gurth added by outline strokes on shapes.


comments powered by Disqus