X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FVectorGraphics.java;h=55c0930f36c31a570c8220b32c1afc9a4527ea6d;hb=5e8485ac88b45693b5cdb8e70f346b92732eb91f;hp=e028caad01f0ab8a09966877319631622ea1b2e4;hpb=352be48caa164460eea7d5c500560154be57117a;p=org.ibex.core.git diff --git a/src/org/xwt/VectorGraphics.java b/src/org/xwt/VectorGraphics.java index e028caa..55c0930 100644 --- a/src/org/xwt/VectorGraphics.java +++ b/src/org/xwt/VectorGraphics.java @@ -78,6 +78,13 @@ public final class VectorGraphics { public static Affine flip(boolean horiz, boolean vert) { return new Affine(horiz ? -1 : 1, 0, 0, vert ? -1 : 1, 0, 0); } public float multiply_px(float x, float y) { return x * a + y * c + e; } public float multiply_py(float x, float y) { return x * b + y * d + f; } + public boolean equalsIgnoringTranslation(Affine x) { return a == x.a && b == x.b && c == x.c && d == x.d; } + + public boolean equals(Object o) { + if (!(o instanceof Affine)) return false; + Affine x = (Affine)o; + return a == x.a && b == x.b && c == x.c && d == x.d && e == x.e && f == x.f; + } public static Affine rotate(float degrees) { float s = (float)Math.sin(degrees * (float)(Math.PI / 180.0)); @@ -191,20 +198,6 @@ public final class VectorGraphics { static final byte TYPE_CUBIC = 3; static final byte TYPE_QUADRADIC = 4; - // FEATURE: make this faster and cache it; also deal with negative coordinates - public int boundingBoxWidth() { - int ret = 0; - for(int i=0; i