瀏覽代碼

Merge pull request #78 from darkdarkdragon/js_fixes

Js fixes
Nicolas Cannasse 11 年之前
父節點
當前提交
286a0a81c1
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      h2d/Drawable.hx
  2. 2 1
      h2d/Text.hx

+ 1 - 1
h2d/Drawable.hx

@@ -94,7 +94,7 @@ class Drawable extends Sprite {
 	}
 
 	public function getShader< T:hxsl.Shader >( stype : Class<T> ) : T {
-		for( s in shaders )
+		if (shaders != null) for( s in shaders )
 			if( Std.is(s, stype) )
 				return cast s;
 		return null;

+ 2 - 1
h2d/Text.hx

@@ -27,6 +27,7 @@ class Text extends Drawable {
 		this.font = font;
 		textAlign = Left;
 		letterSpacing = 1;
+        lineSpacing = 0;
 		text = "";
 		textColor = 0xFFFFFF;
 	}
@@ -185,4 +186,4 @@ class Text extends Drawable {
 		return c;
 	}
 
-}
+}