The app crashes if there's a component that is reduced to 0 pixels with 'Cache Boost' enabled

This commit is contained in:
Bane Stojkovic
2022-07-13 12:04:59 +02:00
parent 746d6c06e7
commit 969c7ebdc1
2 changed files with 25 additions and 1 deletions
@@ -96,7 +96,11 @@ public class DrawingCache {
// if we need to apply caching
Point2D firstPoint = component.getControlPoint(0);
CacheValue value = renderAndCache(component, g2d, componentState, outlineMode, project, zoom);
CacheValue value = renderAndCache(component, g2d, componentState, outlineMode, project, zoom);
if (value == null) {
return;
}
long componentStart = System.nanoTime();
@@ -195,6 +199,10 @@ public class DrawingCache {
int dx = (int) (firstPoint.getX() - rect.getX());
int dy = (int) (firstPoint.getY() - rect.getY());
if (width <= 0 || height <= 0) {
return null;
}
// create image
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
// create graphics
@@ -3885,5 +3885,21 @@
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
<org.diylc.appframework.update.Version>
<versionNumber>
<major>4</major>
<minor>26</minor>
<build>0</build>
</versionNumber>
<releaseDate>2022-07-09 00:00:00.000 CET</releaseDate>
<name></name>
<changes>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>The app crashes if there's a component that is reduced to 0 pixels with 'Cache Boost' enabled</description>
</org.diylc.appframework.update.Change>
</changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version>
</a>
</java.util.Arrays_-ArrayList>