Dan Sinclair | 2eddb66 | 2017-05-25 16:49:51 -0400 | [diff] [blame] | 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 | |
Dan Sinclair | 24ef633 | 2017-07-24 10:52:57 -0400 | [diff] [blame] | 7 | #include "xfa/fxfa/cxfa_ffrectangle.h" |
Dan Sinclair | 2eddb66 | 2017-05-25 16:49:51 -0400 | [diff] [blame] | 8 | |
| 9 | CXFA_FFRectangle::CXFA_FFRectangle(CXFA_WidgetAcc* pDataAcc) |
| 10 | : CXFA_FFDraw(pDataAcc) {} |
| 11 | |
| 12 | CXFA_FFRectangle::~CXFA_FFRectangle() {} |
| 13 | |
Dan Sinclair | 2b918c8 | 2017-07-13 14:47:10 -0400 | [diff] [blame] | 14 | void CXFA_FFRectangle::RenderWidget(CXFA_Graphics* pGS, |
Lei Zhang | 7c9d4c2 | 2017-08-17 13:53:52 -0700 | [diff] [blame] | 15 | const CFX_Matrix& matrix, |
Dan Sinclair | 2eddb66 | 2017-05-25 16:49:51 -0400 | [diff] [blame] | 16 | 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 Zhang | 7c9d4c2 | 2017-08-17 13:53:52 -0700 | [diff] [blame] | 30 | mtRotate.Concat(matrix); |
Dan Sinclair | 2eddb66 | 2017-05-25 16:49:51 -0400 | [diff] [blame] | 31 | |
Lei Zhang | 4b47214 | 2017-08-17 14:30:08 -0700 | [diff] [blame] | 32 | DrawBorder(pGS, rtObj, rect, mtRotate); |
Dan Sinclair | 2eddb66 | 2017-05-25 16:49:51 -0400 | [diff] [blame] | 33 | } |