blob: fe71048bc7df8c06b18c5464fcb13c0e9d5ab9a4 [file] [log] [blame]
Dan Sinclair2eddb662017-05-25 16:49:51 -04001// 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
Dan Sinclair24ef6332017-07-24 10:52:57 -04007#include "xfa/fxfa/cxfa_ffrectangle.h"
Dan Sinclair2eddb662017-05-25 16:49:51 -04008
9CXFA_FFRectangle::CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc)
10 : CXFA_FFDraw(pDataAcc) {}
11
12CXFA_FFRectangle::~CXFA_FFRectangle() {}
13
Dan Sinclair2b918c82017-07-13 14:47:10 -040014void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS,
Lei Zhang7c9d4c22017-08-17 13:53:52 -070015 const CFX_Matrix& matrix,
Dan Sinclair2eddb662017-05-25 16:49:51 -040016 uint32_t dwStatus) {
17 if (!IsMatchVisibleStatus(dwStatus))
18 return;
19
20 CXFA_Value value = m_pDataAcc->GetFormValue();
21 if (!value)
22 return;
23
24 CXFA_Rectangle rtObj = value.GetRectangle();
25 CFX_RectF rect = GetRectWithoutRotate();
26 if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin())
27 XFA_RectWidthoutMargin(rect, mgWidget);
28
29 CFX_Matrix mtRotate = GetRotateMatrix();
Lei Zhang7c9d4c22017-08-17 13:53:52 -070030 mtRotate.Concat(matrix);
Dan Sinclair2eddb662017-05-25 16:49:51 -040031
Lei Zhang4b472142017-08-17 14:30:08 -070032 DrawBorder(pGS, rtObj, rect, mtRotate);
Dan Sinclair2eddb662017-05-25 16:49:51 -040033}