Shape caching entfernt

In Tests konnten keine Geschwindigkeitsvorteile festgestellt werden.
This commit is contained in:
ngb
2022-07-25 19:05:28 +02:00
parent bd2364a8df
commit 97ff03990a
2 changed files with 4 additions and 21 deletions

View File

@@ -15,6 +15,8 @@ public class Rectangle extends Shape {
this.width = width;
this.height = height;
this.anchor = Options.Direction.NORTHWEST;
//this.cacheEnabled = getClass().equals(Rectangle.class);
}
public Rectangle( Rectangle pRechteck ) {
@@ -64,12 +66,10 @@ public class Rectangle extends Shape {
public void setWidth( double width ) {
this.width = width;
invalidate();
}
public void setHeight( double height ) {
this.height = height;
invalidate();
}
@Override
@@ -92,7 +92,6 @@ public class Rectangle extends Shape {
super.scale(factor);
width *= factor;
height *= factor;
invalidate();
}
@Override

View File

@@ -66,11 +66,6 @@ public abstract class Shape extends FilledShape {
*/
protected Options.Direction anchor = Options.Direction.CENTER;
/**
* Zwischenspeicher für die AWT-Shape zu dieser Form.
*/
protected java.awt.Shape awtShape = null;
/**
* Setzt die x- und y-Koordinate der Form auf 0.
*/
@@ -406,13 +401,6 @@ public abstract class Shape extends FilledShape {
*/
public abstract java.awt.Shape getShape();
/**
* Interne Methode, um den Zwischenspeicher der Java-AWT Shape zu löschen.
*/
protected void invalidate() {
awtShape = null;
}
/**
* Gibt die Begrenzungen der Form zurück.
* <p>
@@ -566,12 +554,8 @@ public abstract class Shape extends FilledShape {
return;
}
if( awtShape == null ) {
awtShape = getShape();
}
if( awtShape != null ) {
java.awt.Shape shape = awtShape;
java.awt.Shape shape = getShape();
if( shape != null ) {
if( transform != null ) {
shape = transform.createTransformedShape(shape);
}