fixes for html5
This commit is contained in:
@@ -34,7 +34,7 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
layoutVAlign = VAlign.NONE;
|
||||
textField = buildTextField();
|
||||
textField.width = 1;
|
||||
textField.height = #if html5 25 #else 1 #end;
|
||||
textField.height = 1;
|
||||
textField.wordWrap = true;
|
||||
textFormat = textField.defaultTextFormat;
|
||||
textFormat.font = "Arial";
|
||||
@@ -93,11 +93,7 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
private function set_align(value:TextFormatAlign):TextFormatAlign {
|
||||
if (align != value) {
|
||||
align = value;
|
||||
#if (flash || html5)
|
||||
textFormat.align = value;
|
||||
#else
|
||||
textFormat.align = Std.string(value);
|
||||
#end
|
||||
invalidate();
|
||||
}
|
||||
return align;
|
||||
@@ -148,6 +144,7 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
textField.autoSize = fill ? TextFieldAutoSize.NONE : TextFieldAutoSize.LEFT;
|
||||
var t:String = currentText();
|
||||
if (t != null) textField.text = t;
|
||||
textField.setTextFormat(textFormat);
|
||||
if (contentSize && !Std.is(skin, ISize)) {
|
||||
width = textField.width + paddings * 2;
|
||||
height = textField.height + paddings * 2;
|
||||
@@ -173,17 +170,20 @@ class TextView extends SpriteView implements ITextView<Sprite, TextField> {
|
||||
textField.x = paddings;
|
||||
textField.y = paddings;
|
||||
} else {
|
||||
#if html5 textField.height = textField.textHeight; #end
|
||||
textField.x = switch (layoutHAlign) {
|
||||
case HAlign.NONE: 0;
|
||||
case HAlign.LEFT: paddings;
|
||||
case HAlign.CENTER: (width - textField.width) / 2;
|
||||
case HAlign.RIGHT: width - textField.width - paddings;
|
||||
default: 0;
|
||||
}
|
||||
textField.y = switch (layoutVAlign) {
|
||||
case VAlign.NONE: 0;
|
||||
case VAlign.TOP: paddings;
|
||||
case VAlign.MIDDLE: (height - textField.height) / 2;
|
||||
case VAlign.BOTTOM: height - textField.height - paddings;
|
||||
default: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class DrawUtil {
|
||||
var m:Matrix = new Matrix();
|
||||
var sx:Float = 1.0;
|
||||
var sy:Float = 1.0;
|
||||
fillType = Type.createEnum(FillType, Std.string(fillType));
|
||||
switch (fillType) {
|
||||
case FillType.REPEAT:
|
||||
graphics.beginBitmapFill(image, m, true, false);
|
||||
|
||||
Reference in New Issue
Block a user