Skip to content

Commit

Permalink
Merge pull request #3584 from kwvanderlinde/bugfix/3583-incorrectly-r…
Browse files Browse the repository at this point in the history
…endering-dirty-regions

Always size the BufferedImagePool to the ZoneRenderer size
  • Loading branch information
Phergus authored Sep 3, 2022
2 parents 6fbf210 + 3d2364b commit 54794eb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -841,15 +841,16 @@ public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g;

timer.start("paintComponent:allocateBuffer");
final var bounds = g2d.getClipBounds();
tempBufferPool.setWidth(bounds.width);
tempBufferPool.setHeight(bounds.height);
tempBufferPool.setWidth(getSize().width);
tempBufferPool.setHeight(getSize().height);
tempBufferPool.setConfiguration(g2d.getDeviceConfiguration());
timer.stop("paintComponent:allocateBuffer");

try (final var bufferHandle = tempBufferPool.acquire()) {
final var buffer = bufferHandle.get();
final var bufferG2d = buffer.createGraphics();
// Keep the clip so we don't render more than we have to.
bufferG2d.setClip(g2d.getClip());

timer.start("paintComponent:createView");
PlayerView pl = getPlayerView();
Expand Down

0 comments on commit 54794eb

Please sign in to comment.