Răsfoiți Sursa

Change Text and ScaleGrid to sizes Float.

Yanrishatum 6 ani în urmă
părinte
comite
d6c96253af
2 a modificat fișierele cu 8 adăugiri și 8 ștergeri
  1. 4 4
      h2d/ScaleGrid.hx
  2. 4 4
      h2d/Text.hx

+ 4 - 4
h2d/ScaleGrid.hx

@@ -6,8 +6,8 @@ class ScaleGrid extends h2d.TileGroup {
 	public var borderWidth(default,set) : Int;
 	public var borderHeight(default,set) : Int;
 
-	public var width(default,set) : Int;
-	public var height(default,set) : Int;
+	public var width(default,set) : Float;
+	public var height(default,set) : Float;
 
 	public var tileBorders(default, set) : Bool;
 
@@ -15,8 +15,8 @@ class ScaleGrid extends h2d.TileGroup {
 		super(tile,parent);
 		borderWidth = borderW;
 		borderHeight = borderH;
-		width = Std.int(tile.width);
-		height = Std.int(tile.height);
+		width = tile.width;
+		height = tile.height;
 	}
 
 	function set_tileBorders(b) {

+ 4 - 4
h2d/Text.hx

@@ -16,8 +16,8 @@ class Text extends Drawable {
 	public var maxWidth(default, set) : Null<Float>;
 	public var dropShadow : { dx : Float, dy : Float, color : Int, alpha : Float };
 
-	public var textWidth(get, null) : Int;
-	public var textHeight(get, null) : Int;
+	public var textWidth(get, null) : Float;
+	public var textHeight(get, null) : Float;
 	public var textAlign(default, set) : Align;
 	public var letterSpacing(default, set) : Float;
 	public var lineSpacing(default,set) : Float;
@@ -292,12 +292,12 @@ class Text extends Drawable {
 
 	function get_textHeight() {
 		updateSize();
-		return Math.ceil(calcHeight);
+		return calcHeight;
 	}
 
 	function get_textWidth() {
 		updateSize();
-		return Math.ceil(calcWidth);
+		return calcWidth;
 	}
 
 	function set_maxWidth(w) {