mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 06:33:34 +02:00
Shape caching entfernt
In Tests konnten keine Geschwindigkeitsvorteile festgestellt werden.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user