summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-08-31 12:47:58 -0700
committerDianne Hackborn <hackbod@google.com>2011-08-31 14:18:32 -0700
commitd040edbae968d826aa2c82d382345811a45c646b (patch)
treea2193bbef37a990257ebabc7953b16409aac453e /graphics
parentbe566b488a78e9e5ba0971ebe888d41511a11fa8 (diff)
downloadframeworks_base-d040edbae968d826aa2c82d382345811a45c646b.zip
frameworks_base-d040edbae968d826aa2c82d382345811a45c646b.tar.gz
frameworks_base-d040edbae968d826aa2c82d382345811a45c646b.tar.bz2
Use floating point window positions.
Gets rid of gapps between windows during animations. Change-Id: I17d2ef0af214008f0eabd7eb19268f145fe83b39
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/RectF.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/RectF.java b/graphics/java/android/graphics/RectF.java
index 2b3aa33..00e9609 100644
--- a/graphics/java/android/graphics/RectF.java
+++ b/graphics/java/android/graphics/RectF.java
@@ -16,6 +16,8 @@
package android.graphics;
+import java.io.PrintWriter;
+
import android.os.Parcel;
import android.os.Parcelable;
import android.util.FloatMath;
@@ -81,8 +83,37 @@ public class RectF implements Parcelable {
return "RectF(" + left + ", " + top + ", "
+ right + ", " + bottom + ")";
}
+
+ /**
+ * Return a string representation of the rectangle in a compact form.
+ */
+ public String toShortString() {
+ return toShortString(new StringBuilder(32));
+ }
/**
+ * Return a string representation of the rectangle in a compact form.
+ * @hide
+ */
+ public String toShortString(StringBuilder sb) {
+ sb.setLength(0);
+ sb.append('['); sb.append(left); sb.append(',');
+ sb.append(top); sb.append("]["); sb.append(right);
+ sb.append(','); sb.append(bottom); sb.append(']');
+ return sb.toString();
+ }
+
+ /**
+ * Print short representation to given writer.
+ * @hide
+ */
+ public void printShortString(PrintWriter pw) {
+ pw.print('['); pw.print(left); pw.print(',');
+ pw.print(top); pw.print("]["); pw.print(right);
+ pw.print(','); pw.print(bottom); pw.print(']');
+ }
+
+ /**
* Returns true if the rectangle is empty (left >= right or top >= bottom)
*/
public final boolean isEmpty() {