| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/core/cfwl_picturebox.h" | 7 #include "xfa/fwl/core/cfwl_picturebox.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 return FWL_Type::PictureBox; | 23 return FWL_Type::PictureBox; |
| 24 } | 24 } |
| 25 | 25 |
| 26 void CFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | 26 void CFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
| 27 if (!bAutoSize) { | 27 if (!bAutoSize) { |
| 28 rect = m_pProperties->m_rtWidget; | 28 rect = m_pProperties->m_rtWidget; |
| 29 return; | 29 return; |
| 30 } | 30 } |
| 31 | 31 |
| 32 rect.Set(0, 0, 0, 0); | 32 rect.Set(0, 0, 0, 0); |
| 33 | 33 InflateWidgetRect(rect); |
| 34 CFWL_Widget::GetWidgetRect(rect, true); | |
| 35 } | 34 } |
| 36 | 35 |
| 37 void CFWL_PictureBox::Update() { | 36 void CFWL_PictureBox::Update() { |
| 38 if (IsLocked()) | 37 if (IsLocked()) |
| 39 return; | 38 return; |
| 40 if (!m_pProperties->m_pThemeProvider) | 39 if (!m_pProperties->m_pThemeProvider) |
| 41 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 40 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 42 | 41 |
| 43 GetClientRect(m_rtClient); | 42 GetClientRect(m_rtClient); |
| 44 } | 43 } |
| 45 | 44 |
| 46 void CFWL_PictureBox::DrawWidget(CFX_Graphics* pGraphics, | 45 void CFWL_PictureBox::DrawWidget(CFX_Graphics* pGraphics, |
| 47 const CFX_Matrix* pMatrix) { | 46 const CFX_Matrix* pMatrix) { |
| 48 if (!pGraphics) | 47 if (!pGraphics) |
| 49 return; | 48 return; |
| 50 if (!m_pProperties->m_pThemeProvider) | 49 if (!m_pProperties->m_pThemeProvider) |
| 51 return; | 50 return; |
| 52 | 51 |
| 53 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); | 52 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); |
| 54 if (HasBorder()) | 53 if (HasBorder()) |
| 55 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); | 54 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); |
| 56 if (HasEdge()) | 55 if (HasEdge()) |
| 57 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); | 56 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); |
| 58 } | 57 } |
| 59 | 58 |
| 60 void CFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, | 59 void CFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, |
| 61 const CFX_Matrix* pMatrix) { | 60 const CFX_Matrix* pMatrix) { |
| 62 DrawWidget(pGraphics, pMatrix); | 61 DrawWidget(pGraphics, pMatrix); |
| 63 } | 62 } |
| OLD | NEW |