diff options
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/fx_basic_coords.cpp | 15 | ||||
-rw-r--r-- | core/fxcrt/fx_coordinates.h | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/core/fxcrt/fx_basic_coords.cpp b/core/fxcrt/fx_basic_coords.cpp index e8abace53d..c5ee4048a2 100644 --- a/core/fxcrt/fx_basic_coords.cpp +++ b/core/fxcrt/fx_basic_coords.cpp @@ -197,6 +197,14 @@ FX_RECT CFX_FloatRect::GetClosestRect() const { return rect; } +bool CFX_FloatRect::Contains(const CFX_FloatPoint& point) const { + return Contains(point.x, point.y); +} + +bool CFX_FloatRect::Contains(const CFX_PointF& point) const { + return Contains(point.x, point.y); +} + bool CFX_FloatRect::Contains(const CFX_FloatRect& other_rect) const { CFX_FloatRect n1(*this); CFX_FloatRect n2(other_rect); @@ -377,6 +385,13 @@ void CFX_Matrix::TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const { y = fy; } +CFX_PointF CFX_Matrix::Transform(const CFX_PointF& p) const { + FX_FLOAT x = p.x; + FX_FLOAT y = p.y; + TransformPoint(x, y); + return CFX_PointF(x, y); +} + void CFX_Matrix::TransformRect(CFX_RectF& rect) const { FX_FLOAT right = rect.right(), bottom = rect.bottom(); TransformRect(rect.left, right, bottom, rect.top); diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h index c9e5433226..172d794e97 100644 --- a/core/fxcrt/fx_coordinates.h +++ b/core/fxcrt/fx_coordinates.h @@ -495,6 +495,8 @@ class CFX_FloatRect { } bool IsEmpty() const { return left >= right || bottom >= top; } + bool Contains(const CFX_FloatPoint& point) const; + bool Contains(const CFX_PointF& point) const; bool Contains(const CFX_FloatRect& other_rect) const; bool Contains(FX_FLOAT x, FX_FLOAT y) const; @@ -669,6 +671,7 @@ class CFX_Matrix { FX_FLOAT TransformDistance(FX_FLOAT distance) const; void TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const; + CFX_PointF Transform(const CFX_PointF& p) const; void TransformRect(CFX_RectF& rect) const; void TransformRect(FX_FLOAT& left, |