@@ -20,11 +20,11 @@ var GameObject = require('../GameObject');
2020 * @param {Phaser.GameObjects.Graphics } src - The Game Object being rendered in this call.
2121 * @param {number } interpolationPercentage - Reserved for future use and custom pipelines.
2222 * @param {Phaser.Cameras.Scene2D.Camera } camera - The Camera that is rendering the Game Object.
23+ * @param {Phaser.GameObjects.Components.TransformMatrix } parentMatrix - This transform matrix is defined if the game object is nested
2324 * @param {CanvasRenderingContext2D } renderTargetCtx - [description]
2425 * @param {boolean } allowClip - [description]
25- * @param {Phaser.GameObjects.Components.TransformMatrix } parentMatrix - This transform matrix is defined if the game object is nested
2626 */
27- var GraphicsCanvasRenderer = function ( renderer , src , interpolationPercentage , camera , renderTargetCtx , allowClip , parentMatrix )
27+ var GraphicsCanvasRenderer = function ( renderer , src , interpolationPercentage , camera , parentMatrix , renderTargetCtx , allowClip )
2828{
2929 if ( GameObject . RENDER_MASK !== src . renderFlags || ( src . cameraFilter > 0 && ( src . cameraFilter & camera . _id ) ) )
3030 {
@@ -70,6 +70,11 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c
7070 }
7171
7272 ctx . save ( ) ;
73+ if ( parentMatrix !== undefined )
74+ {
75+ var matrix = parentMatrix . matrix ;
76+ ctx . transform ( matrix [ 0 ] , matrix [ 1 ] , matrix [ 2 ] , matrix [ 3 ] , matrix [ 4 ] , matrix [ 5 ] ) ;
77+ }
7378 ctx . translate ( srcX - cameraScrollX , srcY - cameraScrollY ) ;
7479 ctx . rotate ( srcRotation ) ;
7580 ctx . scale ( srcScaleX , srcScaleY ) ;
0 commit comments