summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_edit.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-09-24 17:55:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-09-24 17:55:00 +0000
commitfed6e124109f089a38e24e37b104d983231bee78 (patch)
tree6c1aa45a97eb27c67611dbe7480bdbcd26710d14 /fpdfsdk/pwl/cpwl_edit.cpp
parent97f4483de007c2ff248696f24d34634e0adbf894 (diff)
downloadpdfium-fed6e124109f089a38e24e37b104d983231bee78.tar.xz
Give CFX_GraphStateData a work-over.chromium/3561
Use std::vector<float> for dash array. Use compiler-generated default operations. Squeeze some enums. Fix obvious logic botch in DashChanged(). Change-Id: If1d809cc46a3cf2db98a09a3f5a49d22138c0640 Reviewed-on: https://pdfium-review.googlesource.com/42613 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_edit.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_edit.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index c4ff2f4bd4..4cd238b679 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -201,12 +201,10 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
case BorderStyle::DASH: {
CFX_GraphStateData gsd;
- gsd.m_LineWidth = (float)GetBorderWidth();
-
- gsd.SetDashCount(2);
- gsd.m_DashArray[0] = (float)GetBorderDash().nDash;
- gsd.m_DashArray[1] = (float)GetBorderDash().nGap;
- gsd.m_DashPhase = (float)GetBorderDash().nPhase;
+ gsd.m_LineWidth = static_cast<float>(GetBorderWidth());
+ gsd.m_DashArray = {static_cast<float>(GetBorderDash().nDash),
+ static_cast<float>(GetBorderDash().nGap)};
+ gsd.m_DashPhase = static_cast<float>(GetBorderDash().nPhase);
CFX_PathData path;
for (int32_t i = 0; i < nCharArray - 1; i++) {