Skip to content

Commit

Permalink
Java2d rendering waits for the window to exit
Browse files Browse the repository at this point in the history
This prevents the window being closed as soon as rendering has
completed. I'm not sure of the impact on animations.
  • Loading branch information
noelwelsh committed Sep 23, 2024
1 parent 4294340 commit ee87a52
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ object Java2dRenderer extends Renderer[Algebra, Frame, Canvas] {
def canvas(description: Frame): Resource[IO, Canvas] =
Canvas(description)

def render[A](canvas: Canvas)(picture: Picture[A]): IO[A] =
canvas.render(picture)
def render[A](canvas: Canvas)(picture: Picture[A]): IO[A] = {
val result = canvas.render(picture)
canvas.closed >> result
}
}

0 comments on commit ee87a52

Please sign in to comment.