Skip to content

Conversation

@thobbs
Copy link

@thobbs thobbs commented Mar 25, 2020

Using copy() a PGraphicsJava2D with a src that is also PGraphicsJava2D will produce the following error:

class sun.java2d.SunGraphics2D cannot be cast to class java.awt.Image

This is due to PGraphicsJava2D.native() returning g2 (a PGraphicsJava2D instance) rather than a java.awt.Image instance, which is what the cast here expects.

I've added specific handling for src being PGraphicsJava2D, as well as general handling of other non-Image results from src.getNative(). I built and tested this solution locally.

@thobbs
Copy link
Author

thobbs commented Mar 25, 2021

Friendly bump after one year - any chance this could be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant