mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-04-14 14:43:33 +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.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.anchor = Options.Direction.NORTHWEST;
|
this.anchor = Options.Direction.NORTHWEST;
|
||||||
|
|
||||||
|
//this.cacheEnabled = getClass().equals(Rectangle.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rectangle( Rectangle pRechteck ) {
|
public Rectangle( Rectangle pRechteck ) {
|
||||||
@@ -64,12 +66,10 @@ public class Rectangle extends Shape {
|
|||||||
|
|
||||||
public void setWidth( double width ) {
|
public void setWidth( double width ) {
|
||||||
this.width = width;
|
this.width = width;
|
||||||
invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHeight( double height ) {
|
public void setHeight( double height ) {
|
||||||
this.height = height;
|
this.height = height;
|
||||||
invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -92,7 +92,6 @@ public class Rectangle extends Shape {
|
|||||||
super.scale(factor);
|
super.scale(factor);
|
||||||
width *= factor;
|
width *= factor;
|
||||||
height *= factor;
|
height *= factor;
|
||||||
invalidate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -66,11 +66,6 @@ public abstract class Shape extends FilledShape {
|
|||||||
*/
|
*/
|
||||||
protected Options.Direction anchor = Options.Direction.CENTER;
|
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.
|
* 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();
|
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.
|
* Gibt die Begrenzungen der Form zurück.
|
||||||
* <p>
|
* <p>
|
||||||
@@ -566,12 +554,8 @@ public abstract class Shape extends FilledShape {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( awtShape == null ) {
|
java.awt.Shape shape = getShape();
|
||||||
awtShape = getShape();
|
if( shape != null ) {
|
||||||
}
|
|
||||||
|
|
||||||
if( awtShape != null ) {
|
|
||||||
java.awt.Shape shape = awtShape;
|
|
||||||
if( transform != null ) {
|
if( transform != null ) {
|
||||||
shape = transform.createTransformedShape(shape);
|
shape = transform.createTransformedShape(shape);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user