summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_coordinates.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fx_coordinates.h')
-rw-r--r--core/fxcrt/fx_coordinates.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h
index 79f7d4f29e..bcbdc0b804 100644
--- a/core/fxcrt/fx_coordinates.h
+++ b/core/fxcrt/fx_coordinates.h
@@ -543,6 +543,16 @@ class CFX_FloatRect {
Deflate(rt.left, rt.bottom, rt.right, rt.top);
}
+ CFX_FloatRect GetDeflated(float x, float y) const {
+ if (IsEmpty())
+ return CFX_FloatRect();
+
+ CFX_FloatRect that = *this;
+ that.Deflate(x, y);
+ that.Normalize();
+ return that;
+ }
+
void Translate(float e, float f) {
left += e;
right += e;