Skip to content

Instantly share code, notes, and snippets.

@james4k
Created August 21, 2015 01:29
Show Gist options
  • Save james4k/49a1bd7c440c55015b94 to your computer and use it in GitHub Desktop.
Save james4k/49a1bd7c440c55015b94 to your computer and use it in GitHub Desktop.
diff --git a/openfl/display/Bitmap.hx b/openfl/display/Bitmap.hx
index 94a4b32..a481bd3 100644
--- a/openfl/display/Bitmap.hx
+++ b/openfl/display/Bitmap.hx
@@ -187,8 +187,23 @@ class Bitmap extends DisplayObject {
@:noCompletion @:dox(hide) public override function __renderGL (renderSession:RenderSession):Void {-
+
+ if (scrollRect != null) {
+ renderSession.spriteBatch.stop();
+ var m = __worldTransform.clone();
+ var clip = Rectangle.__temp;
+ scrollRect.__transform(clip, m);
+ clip.y = renderSession.renderer.height - clip.y - clip.height;
+
+ renderSession.spriteBatch.start(clip);
+ }
+
GLBitmap.render (this, renderSession);
+
+ if (scrollRect != null) {
+ renderSession.spriteBatch.stop();
+ renderSession.spriteBatch.start();
+ }
}
@@ -280,4 +295,4 @@ typedef Bitmap = openfl._legacy.display.Bitmap;
#end
#else
typedef Bitmap = flash.display.Bitmap;
-#end
\ No newline at end of file
+#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment