summaryrefslogtreecommitdiff
path: root/platform/java/com/artifex/mupdf/fitz/Rect.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/java/com/artifex/mupdf/fitz/Rect.java')
-rw-r--r--platform/java/com/artifex/mupdf/fitz/Rect.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/platform/java/com/artifex/mupdf/fitz/Rect.java b/platform/java/com/artifex/mupdf/fitz/Rect.java
index eb9138cf..819646e8 100644
--- a/platform/java/com/artifex/mupdf/fitz/Rect.java
+++ b/platform/java/com/artifex/mupdf/fitz/Rect.java
@@ -7,29 +7,30 @@ public class Rect
public float x1;
public float y1;
- public Rect(float x0, float y0, float x1, float y1)
- {
+ public Rect(float x0, float y0, float x1, float y1) {
this.x0 = x0;
this.y0 = y0;
this.x1 = x1;
this.y1 = y1;
}
- public Rect(Rect r)
- {
- this.x0 = r.x0;
- this.y0 = r.y0;
- this.x1 = r.x1;
- this.y1 = r.y1;
+ public Rect(Rect r) {
+ this(r.x0, r.y0, r.x1, r.y1);
}
- public Rect transform(Matrix tm)
- {
+ public Rect(RectI r) {
+ this(r.x0, r.y0, r.x1, r.y1);
+ }
+
+ public String toString() {
+ return "[" + x0 + " " + y0 + " " + x1 + " " + y1 + "]";
+ }
+
+ public Rect transform(Matrix tm) {
float ax0 = x0 * tm.a;
float ax1 = x1 * tm.a;
- if (ax0 > ax1)
- {
+ if (ax0 > ax1) {
float t = ax0;
ax0 = ax1;
ax1 = t;
@@ -38,8 +39,7 @@ public class Rect
float cy0 = y0 * tm.c;
float cy1 = y1 * tm.c;
- if (cy0 > cy1)
- {
+ if (cy0 > cy1) {
float t = cy0;
cy0 = cy1;
cy1 = t;
@@ -50,8 +50,7 @@ public class Rect
float bx0 = x0 * tm.b;
float bx1 = x1 * tm.b;
- if (bx0 > bx1)
- {
+ if (bx0 > bx1) {
float t = bx0;
bx0 = bx1;
bx1 = t;
@@ -60,8 +59,7 @@ public class Rect
float dy0 = y0 * tm.d;
float dy1 = y1 * tm.d;
- if (dy0 > dy1)
- {
+ if (dy0 > dy1) {
float t = dy0;
dy0 = dy1;
dy1 = t;