Skip to content

Instantly share code, notes, and snippets.

@Misiur
Created September 13, 2016 09:16
Show Gist options
  • Save Misiur/a7661be2e44d1074246ebea08e3d815b to your computer and use it in GitHub Desktop.
Save Misiur/a7661be2e44d1074246ebea08e3d815b to your computer and use it in GitHub Desktop.
diff --git a/openfl/display/BitmapData.hx b/openfl/display/BitmapData.hx
index 55a2209..01eeff2 100644
--- a/openfl/display/BitmapData.hx
+++ b/openfl/display/BitmapData.hx
@@ -484,6 +484,14 @@ class BitmapData implements IBitmapDrawable {
renderSession.maskManager.pushRect (clipRect, new Matrix ());
}
+
+ var blendModeCache = renderSession.blendModeManager.currentBlendMode;
+
+ if (blendMode != null) {
+
+ renderSession.blendModeManager.setBlendMode (blendMode);
+
+ }
var matrixCache = source.__worldTransform;
source.__updateTransforms(matrix != null ? matrix : new Matrix ());
@@ -498,6 +506,12 @@ class BitmapData implements IBitmapDrawable {
}
+ if (blendMode != null) {
+
+ renderSession.blendModeManager.setBlendMode (blendModeCache);
+
+ }
+
surface.flush ();
image.dirty = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment