summaryrefslogtreecommitdiff
path: root/core/fxge
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge')
-rw-r--r--core/fxge/cfx_pathdata.cpp4
-rw-r--r--core/fxge/cfx_pathdata.h1
-rw-r--r--core/fxge/cfx_renderdevice.cpp9
3 files changed, 8 insertions, 6 deletions
diff --git a/core/fxge/cfx_pathdata.cpp b/core/fxge/cfx_pathdata.cpp
index 4ac5cf6a7a..ac1ff42629 100644
--- a/core/fxge/cfx_pathdata.cpp
+++ b/core/fxge/cfx_pathdata.cpp
@@ -210,6 +210,10 @@ void CFX_PathData::AppendLine(const CFX_PointF& pt1, const CFX_PointF& pt2) {
AppendPoint(pt2, FXPT_TYPE::LineTo, false);
}
+void CFX_PathData::AppendRect(const CFX_FloatRect& rect) {
+ return AppendRect(rect.left, rect.bottom, rect.right, rect.top);
+}
+
void CFX_PathData::AppendRect(float left,
float bottom,
float right,
diff --git a/core/fxge/cfx_pathdata.h b/core/fxge/cfx_pathdata.h
index d346ba0666..5c2be627bf 100644
--- a/core/fxge/cfx_pathdata.h
+++ b/core/fxge/cfx_pathdata.h
@@ -59,6 +59,7 @@ class CFX_PathData : public Retainable {
bool IsRect(const CFX_Matrix* pMatrix, CFX_FloatRect* rect) const;
void Append(const CFX_PathData* pSrc, const CFX_Matrix* pMatrix);
+ void AppendRect(const CFX_FloatRect& rect);
void AppendRect(float left, float bottom, float right, float top);
void AppendLine(const CFX_PointF& pt1, const CFX_PointF& pt2);
void AppendPoint(const CFX_PointF& pos, FXPT_TYPE type, bool closeFigure);
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 6c7e896b01..2e279d636f 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -1134,8 +1134,7 @@ void CFX_RenderDevice::DrawFillRect(const CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
const FX_COLORREF& color) {
CFX_PathData path;
- CFX_FloatRect rcTemp(rect);
- path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top);
+ path.AppendRect(rect);
DrawPath(&path, pUser2Device, nullptr, color, 0, FXFILL_WINDING);
}
@@ -1155,13 +1154,11 @@ void CFX_RenderDevice::DrawStrokeRect(const CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
const FX_COLORREF& color,
float fWidth) {
- CFX_PathData path;
- CFX_FloatRect rcTemp(rect);
- path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top);
-
CFX_GraphStateData gsd;
gsd.m_LineWidth = fWidth;
+ CFX_PathData path;
+ path.AppendRect(rect);
DrawPath(&path, pUser2Device, &gsd, 0, color, FXFILL_ALTERNATE);
}