|
@@ -45,9 +45,11 @@ class CachedBitmap extends Drawable {
|
|
|
if( scene == null ) return null;
|
|
|
var tw = width < 0 ? scene.width : width;
|
|
|
var th = height < 0 ? scene.height : height;
|
|
|
- var tex = new h3d.mat.Texture(tw, th, [Target]);
|
|
|
- renderDone = false;
|
|
|
- tile = Tile.fromTexture(tex);
|
|
|
+ if( tw != 0 && th != 0 ){
|
|
|
+ var tex = new h3d.mat.Texture(tw, th, [Target]);
|
|
|
+ renderDone = false;
|
|
|
+ tile = Tile.fromTexture(tex);
|
|
|
+ }
|
|
|
}
|
|
|
return tile;
|
|
|
}
|
|
@@ -60,7 +62,8 @@ class CachedBitmap extends Drawable {
|
|
|
}
|
|
|
|
|
|
override function draw( ctx : RenderContext ) {
|
|
|
- emitTile(ctx, tile);
|
|
|
+ if( tile != null )
|
|
|
+ emitTile(ctx, tile);
|
|
|
}
|
|
|
|
|
|
override function drawRec( ctx : RenderContext ) {
|
|
@@ -68,7 +71,7 @@ class CachedBitmap extends Drawable {
|
|
|
if( tile != null && ((width < 0 && scene.width != tile.width) || (height < 0 && scene.height != tile.height)) )
|
|
|
clean();
|
|
|
var tile = getTile(ctx);
|
|
|
- if( !freezed || !renderDone ) {
|
|
|
+ if( (!freezed || !renderDone) && tile != null ) {
|
|
|
var oldA = matA, oldB = matB, oldC = matC, oldD = matD, oldX = absX, oldY = absY;
|
|
|
|
|
|
// init matrix without transformation
|