[HTML5 - webGL - Lime 5.6.0 - OpenFl 6.2.0] BitmapData draw problem with cacheAsBitmap

I have created a composite Sprite “box”, containing a pair of bitmaps and a MovieClip, “mc”: “mc” is cachedAsBitmap and I am applying


for tinting. Then I want to render (.draw) the resulting “box” to a BitmapData, rescaling it to 50% with a Matrix: the problem is that the resulting BitmapData shows the bitmaps correctly rescaled, but “mc” at the original size. I am pretty sure that the problem is cacheAsBitmap.

A simple workaround is to prerender “box” to a temporary BitmapData, and then render this to a new BitmapData applying the matrix, but it would be better if I could avoid it. I still can’t try the new Lime/Openfl version, so I don’t know if this problem has been fixed.

Is there any way you might be able to create a small sample of this? Something like this?

var box = new Sprite ();

var bitmap = new Bitmap (Assets.getBitmapData ("image1.png"));
box.addChild (bitmap);

var bitmap2 = new Bitmap (Assets.getBitmapData ("image2.png"));
box.addChild (bitmap2);

var mc = new MovieClip ();
mc.graphics.beginFill (0xFF0000);
mc.graphics.drawRect (0, 0, 100, 100);
mc.cacheAsBitmap = true;
mc.transform.colorTransform = new ColorTransform (1, 0, 0, 1);
box.addChild (mc);

var bitmapData = new BitmapData (Math.ceil (box.width / 2), Math.ceil (box.height / 2), true, 0);
var matrix = new Matrix ();
matrix.scale (0.5, 0.5);
bitmapData.draw (box, matrix);

var bitmap3 = new Bitmap (bitmapData);
addChild (bitmap3);