diff options
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r-- | xfa/fxfa/parser/cxfa_stroke.cpp | 25 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_stroke.h | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp index c9c7d73f49..45634b26e3 100644 --- a/xfa/fxfa/parser/cxfa_stroke.cpp +++ b/xfa/fxfa/parser/cxfa_stroke.cpp @@ -8,10 +8,12 @@ #include <utility> +#include "xfa/fxfa/cxfa_ffwidget.h" #include "xfa/fxfa/parser/cxfa_color.h" #include "xfa/fxfa/parser/cxfa_measurement.h" #include "xfa/fxfa/parser/cxfa_node.h" #include "xfa/fxfa/parser/xfa_utils.h" +#include "xfa/fxgraphics/cxfa_graphics.h" CXFA_Stroke::CXFA_Stroke(CXFA_Document* pDoc, XFA_PacketType ePacket, @@ -120,3 +122,26 @@ bool CXFA_Stroke::SameStyles(CXFA_Stroke* stroke, uint32_t dwFlags) { } return true; } + +void CXFA_Stroke::Stroke(CXFA_GEPath* pPath, + CXFA_Graphics* pGS, + const CFX_Matrix& matrix) { + if (!IsVisible()) + return; + + float fThickness = GetThickness(); + if (fThickness < 0.001f) + return; + + pGS->SaveGraphState(); + if (IsCorner() && fThickness > 2 * GetRadius()) + fThickness = 2 * GetRadius(); + + pGS->SetLineWidth(fThickness); + pGS->EnableActOnDash(); + pGS->SetLineCap(CFX_GraphStateData::LineCapButt); + XFA_StrokeTypeSetLineDash(pGS, GetStrokeType(), XFA_AttributeEnum::Butt); + pGS->SetStrokeColor(CXFA_GEColor(GetColor())); + pGS->StrokePath(pPath, &matrix); + pGS->RestoreGraphState(); +} diff --git a/xfa/fxfa/parser/cxfa_stroke.h b/xfa/fxfa/parser/cxfa_stroke.h index 42b7ec0c20..d3eeff1ed2 100644 --- a/xfa/fxfa/parser/cxfa_stroke.h +++ b/xfa/fxfa/parser/cxfa_stroke.h @@ -18,6 +18,8 @@ enum StrokeSameStyle { XFA_STROKE_SAMESTYLE_Corner = 2 }; +class CXFA_GEPath; +class CXFA_Graphics; class CXFA_Node; class CXFA_Stroke : public CXFA_Node { @@ -42,6 +44,8 @@ class CXFA_Stroke : public CXFA_Node { bool SameStyles(CXFA_Stroke* stroke, uint32_t dwFlags); + void Stroke(CXFA_GEPath* pPath, CXFA_Graphics* pGS, const CFX_Matrix& matrix); + protected: CXFA_Stroke(CXFA_Document* pDoc, XFA_PacketType ePacket, |