-
1. Re: Why dimensions are not integers?
miguel8312 Jan 27, 2011 2:24 AM (in response to hidarikani)can you be more specific? are you talking about math? in code what exaclty are you referring to?
-
2. Re: Why dimensions are not integers?
_spoboyle Jan 27, 2011 3:43 AM (in response to hidarikani)I assume you are talking about displayobjects and UIcomponents. To be honest I ma not totally sure but i guess its a legacy thing from when there was no int type. also not that it should be a problem for displayobjects but numbers can hold larger values than int
-
3. Re: Why dimensions are not integers?
GordonSmith Jan 27, 2011 10:49 AM (in response to _spoboyle)Coordinates are allowed to be fractional values because the Flash Player does antialiasing when shapes aren't on pixel boundaries. For example, if you draw a 10x10 black square at (100, 100), and then another at (200.5, 200.5), I think you'll see some gray around the edges of the second square.
Gordon Smith
Adobe Flex SDK Team
-
4. Re: Why dimensions are not integers?
Evtim Georgiev (Adobe) Jan 27, 2011 11:04 AM (in response to hidarikani)The reason is that rounding should happen after the coordinates are transformed from local DisplayObject space to global space. The DisplayObject dimensions and coordinates undergo localToGlobal() transformation to get to the fianl pixel coordinates. Rounding to a pixel in local space may be too restrictive, especially when doing animations in context of some transformations. If for example the localToGlobal() scales everything by factor of 2, the ability to specify dimensions in .5 increments means the object will render in 1 pixel increments on screen. If all coordinates were integers only, then animating the object will result in 2 pixel jumps on screen which will look jittery.
-
5. Re: Why dimensions are not integers?
Flex harUI Jan 27, 2011 2:54 PM (in response to _spoboyle)The player actually works in twips for rendering. It uses that resolution
to determine which color to choose for an actual pixel.





