BitmapTextField fix

This commit is contained in:
2015-06-25 17:15:49 +03:00
parent 78fb9bac50
commit 462ee023c3
2 changed files with 19 additions and 24 deletions

View File

@@ -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
View 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;