- me.realOrigin_y = 0.5 * (1 - me.realFontSize_y);
- me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
- me.recalcPos = 0;
+
+ me.recalcPosition(me);
+
+ float lines;
+
+ vector dfs;
+ vector fs;
+
+ // set up variables to draw in condensed size, but use hinting for original size
+ fs = me.realFontSize;
+ fs_x *= me.condenseFactor;
+
+ dfs = draw_fontscale;
+ draw_fontscale_x *= me.condenseFactor;
+
+ if(me.allowCut) // FIXME allowCut incompatible with align != 0
+ lines = 1;
+ else if(me.allowWrap) // FIXME allowWrap incompatible with align != 0
+ {
+ getWrappedLine_remaining = me.text;
+ lines = 0;
+ while(getWrappedLine_remaining)
+ {
+ if (me.allowColors)
+ getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithColors);
+ else
+ getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithoutColors);
+ ++lines;
+ }
+ }
+ else
+ lines = 1;
+
+ draw_fontscale = dfs;
+
+ me.realOrigin_y = 0.5 * (1 - lines * me.realFontSize_y);