mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 02:32:09 +10:00
Render optimization (#1087)
* Caching and culling improvements * doc * Update canvas-rendering-cache-and-culling.md * caching for wires * cache invalidation improvements * caching improvements * twisted wire performance update * Improved grid rendering on screen and when exporting; PDF export of the grid is now vector-based and does not get blurry on zooming in * area append improvement * bug fix for subtracting trace cuts * Twisted wire stroke render improvement * various performance improvements * lazy area merging * regression update * Update update.xml * code cleanup * Twisted wire border thickness fix
This commit is contained in:
@@ -306,7 +306,11 @@ public class CanvasPanel extends JComponent implements Autoscroll {
|
||||
|
||||
Rectangle visibleRect = getVisibleRect();
|
||||
|
||||
if (bufferImage == null) {
|
||||
// the buffer is redrawn in full on every paint, so only a change in size, which includes the
|
||||
// HiDPI scale, calls for a new one; scrolling does not
|
||||
if (bufferImage == null
|
||||
|| bufferImage.getWidth() != (int) Math.round(visibleRect.width * scaleFactor)
|
||||
|| bufferImage.getHeight() != (int) Math.round(visibleRect.height * scaleFactor)) {
|
||||
createBufferImage(visibleRect, scaleFactor);
|
||||
}
|
||||
Graphics2D bufferG2d = (Graphics2D) bufferImage.getGraphics();
|
||||
|
||||
@@ -118,7 +118,6 @@ public class CanvasPlugin implements IPlugIn{
|
||||
|
||||
@Override
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
getCanvasPanel().invalidateCache();
|
||||
getCanvasPanel().revalidate();
|
||||
}
|
||||
});
|
||||
@@ -127,7 +126,6 @@ public class CanvasPlugin implements IPlugIn{
|
||||
|
||||
@Override
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
getCanvasPanel().invalidateCache();
|
||||
getCanvasPanel().revalidate();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user