From 71f2655c2164df944f8c0a711592e843e2a64477 Mon Sep 17 00:00:00 2001 From: Dimensionscape Date: Fri, 14 Feb 2020 14:37:00 -0500 Subject: [PATCH] updated to copy BitmapData with copyPixels(); Update to fix issue with BitmapData distortion on DisplayObjects larger than the stage. --- .../src/starling/display/DisplayObject.as | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/starling/src/starling/display/DisplayObject.as b/starling/src/starling/display/DisplayObject.as index ce16859fb..33704838c 100644 --- a/starling/src/starling/display/DisplayObject.as +++ b/starling/src/starling/display/DisplayObject.as @@ -1,4 +1,4 @@ -// ================================================================================================= +// ================================================================================================= // // Starling Framework // Copyright Gamua GmbH. All Rights Reserved. @@ -457,12 +457,12 @@ package starling.display painter.backBufferHeight * backBufferScale); while (positionInBitmap.y < out.height) - { + { stepX = projectionX; positionInBitmap.x = 0; - + while (positionInBitmap.x < out.width) - { + { painter.clear(color, alpha); painter.state.setProjectionMatrix(stepX, stepY, stepWidth, stepHeight, stageWidth, stageHeight, stage.cameraPosition); @@ -474,15 +474,16 @@ package starling.display if (_mask) painter.eraseMask(mask, this); - painter.finishMeshBatch(); - execute(painter.context.drawToBitmapData, out, boundsInBuffer, positionInBitmap); - + painter.finishMeshBatch(); + var bmd:BitmapData = new BitmapData(stepWidth, stepHeight, true, 0x00ffffff); + painter.context.drawToBitmapData(bmd, boundsInBuffer); + out.copyPixels(bmd, boundsInBuffer,positionInBitmap); + stepX += stepWidth; positionInBitmap.x += stepWidth * totalScaleX; } - stepY += stepHeight; - positionInBitmap.y += stepHeight * totalScaleY; + positionInBitmap.y += stepHeight * totalScaleY; } painter.popState();