BitmapTextField fix
This commit is contained in:
@@ -201,17 +201,9 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
}
|
||||
|
||||
private function placeTextField(textField:TextField):Void {
|
||||
//if (fill) {
|
||||
// textField.width = width - paddings * 2;
|
||||
// textField.height = height - paddings * 2;
|
||||
// textField.x = paddings;
|
||||
// textField.y = paddings;
|
||||
//} else {
|
||||
|
||||
textField.width = width;
|
||||
textField.height = _textHeight;
|
||||
|
||||
//#if html5 textField.height = _textHeight; #end
|
||||
textField.x = switch (layoutHAlign) {
|
||||
case HAlign.NONE: 0;
|
||||
case HAlign.LEFT: leftPadding;
|
||||
@@ -226,7 +218,6 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
case VAlign.BOTTOM: height - _textHeight - bottomPadding;
|
||||
default: 0;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
override private function set_mouseEnabled(value:Bool):Bool {
|
||||
|
||||
4
haxework/text/BitmapTextField.hx
Normal file → Executable file
4
haxework/text/BitmapTextField.hx
Normal file → Executable file
@@ -1,5 +1,6 @@
|
||||
package haxework.text;
|
||||
|
||||
import haxe.Timer;
|
||||
import flash.text.TextFormat;
|
||||
import flash.events.Event;
|
||||
import flash.display.Bitmap;
|
||||
@@ -97,7 +98,10 @@ class BitmapTextField extends TextField {
|
||||
|
||||
private function redraw() {
|
||||
var size = TextUtil.getSize(this);
|
||||
//ToDo: openfl 3.0.6 -> 3.1.0
|
||||
Timer.delay(function() {
|
||||
bitmap.bitmapData = draw(this, size.x, size.y, shadowColor, shadowAlpha, shadow, stroke);
|
||||
}, 1);
|
||||
bitmap.x = x;
|
||||
bitmap.y = y;
|
||||
_invalidated = false;
|
||||
|
||||
Reference in New Issue
Block a user