Skip to content

Commit

Permalink
better handling of matrix in BitmapData drawToSurface
Browse files Browse the repository at this point in the history
git-svn-id: https://nekonme.googlecode.com/svn/trunk@1858 1509560c-5e2a-0410-865c-31c25e1cfdef
  • Loading branch information
Patrick Krekelberg committed Jul 21, 2012
1 parent 7cc95ea commit 8527ae5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions jeash/display/BitmapData.hx
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,19 @@ class BitmapData implements IBitmapDrawable {
blendMode: BlendMode,
clipRect:Rectangle,
smothing:Bool):Void {
jeashBuildLease();
var ctx : CanvasRenderingContext2D = inSurface.getContext('2d');
if (matrix != null) {
ctx.save();
if (matrix.a == 1 && matrix.b == 0 && matrix.c == 0 && matrix.d == 1)
ctx.translate(matrix.tx, matrix.ty);
else
ctx.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);
ctx.restore();
}

jeashBuildLease();

ctx.drawImage(handle(), 0, 0);
ctx.drawImage(handle(), 0, 0);
ctx.restore();
} else
ctx.drawImage(handle(), 0, 0);
}

public function colorTransform(rect:Rectangle, colorTransform:ColorTransform) {
Expand Down

0 comments on commit 8527ae5

Please sign in to comment.