浏览代码

minor fixes wrt domkit

Nicolas Cannasse 5 年之前
父节点
当前提交
877d8eabbd
共有 2 个文件被更改,包括 2 次插入0 次删除
  1. 1 0
      h2d/Bitmap.hx
  2. 1 0
      h2d/domkit/Style.hx

+ 1 - 0
h2d/Bitmap.hx

@@ -71,6 +71,7 @@ class Bitmap extends Drawable {
 			emitTile(ctx,tile);
 			return;
 		}
+		if( tile == null ) tile = h2d.Tile.fromColor(0xFF00FF);
 		var ow = tile.width;
 		var oh = tile.height;
 		@:privateAccess {

+ 1 - 0
h2d/domkit/Style.hx

@@ -228,6 +228,7 @@ class Style extends domkit.CssStyle {
 		if( b.xMin < 0 ) b.xMin = 0;
 		if( b.yMin < 0 ) b.yMin = 0;
 		var scene = obj.getScene();
+		if( scene == null ) return;
 		var p = new h2d.Bitmap(h2d.Tile.fromColor(0xFF0000, Math.round(b.width), Math.round(b.height), 0.1));
 		p.x = Math.round(b.xMin);
 		p.y = Math.round(b.yMin);