ScaleText doesnt work properly

I have a problem with a template, the text does not scale correctly, it is cut, but when I put one more character it adjusts to the object, it is just a question of a pixel, someone knows why ?

i show you my code and example

thanks

It looks like some kind of rounding error. Do you use an embedded font? Are these “phase1” to “phase4” fields al located at -438? From the first picture it looks to me, that there is only one field at that same spot.

yes it looks like rounding error is some code that i can add to the AS3 for this case, something like this ?

You can try that. Sometimes it also helps to append a space " " to the end of the text to be set, before sending it to the ScaleDownTextField function, like:

ScaleDownTextField(element.data.@value.toString() + " ", Barra_Main.phase1, 533, -438, 0);

1 Like

yes, that work perfect thanks so much !!! but i put the + " " on the input right here and is work as wellinput

As I usually have the ScaleDownTextField function somewhere in a library I do it in the code case by case. Otherwise, if you use the library function or just copy the function to another template, you will run into troubles, as it is not always necessary to add the space. That depends on the used font. But sure, it works either way.

1 Like