summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fxge/cfx_renderdevice.cpp7
-rw-r--r--core/fxge/cfx_renderdevice.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 310a16512c..cb0e600916 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -471,6 +471,13 @@ bool CFX_RenderDevice::SetClip_PathStroke(
return true;
}
+bool CFX_RenderDevice::SetClip_Rect(const CFX_RectF& rtClip) {
+ return SetClip_Rect(FX_RECT(static_cast<int32_t>(floor(rtClip.left)),
+ static_cast<int32_t>(floor(rtClip.top)),
+ static_cast<int32_t>(ceil(rtClip.right())),
+ static_cast<int32_t>(ceil(rtClip.bottom()))));
+}
+
bool CFX_RenderDevice::SetClip_Rect(const FX_RECT& rect) {
CFX_PathData path;
path.AppendRect(rect.left, rect.bottom, rect.right, rect.top);
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index ad8e487749..1a69c42b14 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -123,6 +123,7 @@ class CFX_RenderDevice {
bool SetClip_PathFill(const CFX_PathData* pPathData,
const CFX_Matrix* pObject2Device,
int fill_mode);
+ bool SetClip_Rect(const CFX_RectF& pRect);
bool SetClip_Rect(const FX_RECT& pRect);
bool SetClip_PathStroke(const CFX_PathData* pPathData,
const CFX_Matrix* pObject2Device,