mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-14 00:38:41 -04:00
Merge 0f98f14d05
into acb99b6f87
This commit is contained in:
commit
e4a2aae1ea
1 changed files with 7 additions and 0 deletions
|
@ -791,6 +791,9 @@ var Mouse = require('../core/Mouse');
|
|||
c.translate(part.position.x, part.position.y);
|
||||
c.rotate(part.angle);
|
||||
|
||||
// support img style filter
|
||||
if (texture.style && texture.style.filter)
|
||||
context.filter = texture.style.filter;
|
||||
c.drawImage(
|
||||
texture,
|
||||
texture.width * -sprite.xOffset * sprite.xScale,
|
||||
|
@ -798,6 +801,10 @@ var Mouse = require('../core/Mouse');
|
|||
texture.width * sprite.xScale,
|
||||
texture.height * sprite.yScale
|
||||
);
|
||||
// should reset context.filter after draw
|
||||
if (texture.style && texture.style.filter)
|
||||
context.filter = "none";
|
||||
|
||||
|
||||
// revert translation, hopefully faster than save / restore
|
||||
c.rotate(-part.angle);
|
||||
|
|
Loading…
Add table
Reference in a new issue