1 // Copyright 2017 PDFium Authors. All rights reserved. 2 // 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_ffrectangle.h" 8 9 #include "xfa/fxfa/parser/cxfa_rectangle.h" 10 #include "xfa/fxfa/parser/cxfa_value.h" 11 CXFA_FFRectangle(CXFA_Node * pNode)12CXFA_FFRectangle::CXFA_FFRectangle(CXFA_Node* pNode) : CXFA_FFDraw(pNode) {} 13 ~CXFA_FFRectangle()14CXFA_FFRectangle::~CXFA_FFRectangle() {} 15 RenderWidget(CXFA_Graphics * pGS,const CFX_Matrix & matrix,uint32_t dwStatus)16void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, 17 const CFX_Matrix& matrix, 18 uint32_t dwStatus) { 19 if (!IsMatchVisibleStatus(dwStatus)) 20 return; 21 22 CXFA_Value* value = m_pNode->GetFormValueIfExists(); 23 if (!value) 24 return; 25 26 CFX_RectF rect = GetRectWithoutRotate(); 27 CXFA_Margin* margin = m_pNode->GetMarginIfExists(); 28 if (margin) 29 XFA_RectWithoutMargin(rect, margin); 30 31 CFX_Matrix mtRotate = GetRotateMatrix(); 32 mtRotate.Concat(matrix); 33 34 DrawBorder(pGS, value->GetRectangleIfExists(), rect, mtRotate); 35 } 36