blob: 071f4794c39bda88824b2d40968577419afc8b9e [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// Copyright 2017 The PDFium Authors
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "xfa/fxfa/cxfa_ffarc.h"
8
9#include "xfa/fxfa/parser/cxfa_arc.h"
10#include "xfa/fxfa/parser/cxfa_value.h"
11
Haibo Huang49cc9302020-04-27 16:14:24 -070012CXFA_FFArc::CXFA_FFArc(CXFA_Node* pNode) : CXFA_FFWidget(pNode) {}
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070013
kumarashishg826308d2023-06-23 13:21:22 +000014CXFA_FFArc::~CXFA_FFArc() = default;
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070015
kumarashishg826308d2023-06-23 13:21:22 +000016void CXFA_FFArc::RenderWidget(CFGAS_GEGraphics* pGS,
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070017 const CFX_Matrix& matrix,
Haibo Huang49cc9302020-04-27 16:14:24 -070018 HighlightOption highlight) {
19 if (!HasVisibleStatus())
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070020 return;
21
22 CXFA_Value* value = m_pNode->GetFormValueIfExists();
23 if (!value)
24 return;
25
26 CFX_RectF rtArc = GetRectWithoutRotate();
27 CXFA_Margin* margin = m_pNode->GetMarginIfExists();
Haibo Huang49cc9302020-04-27 16:14:24 -070028 XFA_RectWithoutMargin(&rtArc, margin);
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070029
30 CFX_Matrix mtRotate = GetRotateMatrix();
31 mtRotate.Concat(matrix);
Philip P. Moltmannd904c1e2018-03-19 09:26:45 -070032 DrawBorder(pGS, value->GetArcIfExists(), rtArc, mtRotate);
33}