0 Replies Latest reply on Aug 11, 2011 1:45 PM by ixeldog1

    Spark Label positioning is different from Halo Text

    ixeldog1

      I'm rewriting an old Actionscript 1 Flash Player 6 application from scratch in Flex 4.5. The old application used xml files to create its structure and layout and the new version needs to be able to handle the same files.

       

      For the most part while rewriting I've been using spark components (all of my containers are spark.components.Group), but I was temporarily using the old mx.controls.Text object for text. After completing a rough first draft everything looked pretty much like the old version and I decided to replace the Halo Text object with the Spark Label object.

       

      When I did this I noticed that the new Text objects were not positioned the same as the old ones. The Spark Labels are positioned higher than Halo. Also, if a Spark Label is left aligned, it's slightly more to the left than Halo. If it's right aligned it's slightly more to the right. It looks like the Halo Text objects have padding on top, left, and right (probably bottom too, but can't say for sure) that the Spark Labels do not. I'm not setting/modifying any styles that would seem to affect this. The only change I'm making here is instead of "public class myText extends Text" I use "public class myText extends Label". I extend Halo and everything is exactly like the old application. I extend Spark and everything is off.

       

      I've tried fiddling with every style I can find that might help here, and while I've come close to making the text look right (by modifying the Label baselineShift to move it down and adding 2 pixels of padding to the left and right) it's still not right and I don't like having to do that. I feel like there is probably one thing I have to change that should fix this, but I've looked and can't find it. Any help or suggestions would be appreciated.