summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Rect.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Rect.h')
-rw-r--r--libs/hwui/Rect.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 6b22c2b..5166ee9 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -148,6 +148,13 @@ struct Rect {
return false;
}
+ void snapToPixelBoundaries() {
+ left = floor(left);
+ top = floor(top);
+ right = ceil(right);
+ bottom = ceil(bottom);
+ }
+
void dump() const {
LOGD("Rect[l=%f t=%f r=%f b=%f]", left, top, right, bottom);
}