开发者

Text direction backward on spark.components.Label on CartesianDataCanvas

For some reason, my text is coming out reversed (mirror image) when I put a Label component on a Cartesia开发者_JAVA技巧nDataCanvas (all in actionscript). Explicitly specifying "direction" did not help. I'm wondering if backgroundElements can't handle text?

var dataCanvas:CartesianDataCanvas = new CartesianDataCanvas();
cachedBackground[1] = dataCanvas;
this.backgroundElements = cachedBackground;

...

var label:spark.components.Label = new spark.components.Label();
label.text = dimension.name;
label.setStyle("color", color);
label.setStyle("fontSize", this.getStyle("fontSize") + 2);
label.setStyle("fontWeight", "bold");
CartesianDataCanvas(
    cachedBackground[1]).addDataChild(label, this.minimumDate, 0.9);


https://bugs.adobe.com/jira/browse/SDK-27054

I ran into this same issue. The workaround stated in the bug (you can see it in the FXP attached to the bug) worked for me. Basically, try putting this in your class:

private var fix:int = function ():int{
    invalidateProperties(); 
    return 1
}();

Hopefully that helps. It looks like 4.1 had all kinds of issues with mirroring, so hopefully 4.5 will be much better.

Alternatively, if that doesn't work downgrade to 4.0 for the time being, that should also do the trick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜