limweb / degrafa

Automatically exported from code.google.com/p/degrafa
1 stars 0 forks source link

RasterText's internal textField does not update its width / height propperly #92

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an RasterText like one below:

<degrafa:RasterText id="label"                               
x="{xValue}"                                y="{level.currentIndex % 2 != 0 ? 
levelAlternatingDifference : 0}"

align="center"
                                     width="{tickWidth * 5 / 3}"
                                     text="{StringUtil.trim(level.currentDatum)}"
                                     fontFamily="{fontFamily}"
                                     fontSize="{fontSize}"
                                     fontWeight="{fontWeight}">

Notice that align="center" and width property is set using data binding. 
AutoSizeField="false" (by default)

2.
3.

What is the expected output? What do you see instead?

The text inside RasterText is not centered when width property changes.

Please use labels and text to provide additional information.

See RasterText.calculateLayout(): (line 407)
if (!_autoSizeField && !_layoutinited ) 
{
textField.width = width;
}

_layoutinited is true even if the width property has change causing the 
textField not to update its width properly.

Original issue reported on code.google.com by capus...@gmail.com on 12 Oct 2010 at 9:28

GoogleCodeExporter commented 9 years ago
An example of reproducing this is Issue92_reproduce.mxml

Original comment by capus...@gmail.com on 12 Oct 2010 at 10:29

Attachments: