Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
Fix drawing semi-transparent windows in double buffering mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTI1208 committed Mar 22, 2022
1 parent 250177d commit bce0735
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class DoubleBufferedRenderingSurface(bufferCanvasFactory: CanvasFactory, private
// optimization: flush only if the buffer is changed
if (buffer.changed) {
buffer.resetChanged()
target.context2d.drawImage(buffer.imageSource, 0.0, 0.0)
target.context2d.apply {
// clear canvas so that semi-transparent parts won't stack on top of each other
clearRect(0.0, 0.0, buffer.width.toDouble(), buffer.height.toDouble())
drawImage(buffer.imageSource, 0.0, 0.0)
}
}
}

Expand Down

0 comments on commit bce0735

Please sign in to comment.