Browse Source

minor fixes wrt domkit

Nicolas Cannasse 5 years ago
parent
commit
877d8eabbd
2 changed files with 2 additions and 0 deletions
  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);