summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/app/xfa_ffimage.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffimage.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/xfa/fxfa/app/xfa_ffimage.cpp b/xfa/fxfa/app/xfa_ffimage.cpp
index 996a3d6b3b..a613221ea6 100644
--- a/xfa/fxfa/app/xfa_ffimage.cpp
+++ b/xfa/fxfa/app/xfa_ffimage.cpp
@@ -34,34 +34,36 @@ void CXFA_FFImage::UnloadWidget() {
void CXFA_FFImage::RenderWidget(CFX_Graphics* pGS,
CFX_Matrix* pMatrix,
uint32_t dwStatus) {
- if (!IsMatchVisibleStatus(dwStatus)) {
+ if (!IsMatchVisibleStatus(dwStatus))
return;
- }
- CFX_Matrix mtRotate;
- GetRotateMatrix(mtRotate);
- if (pMatrix) {
+
+ CFX_Matrix mtRotate = GetRotateMatrix();
+ if (pMatrix)
mtRotate.Concat(*pMatrix);
- }
+
CXFA_FFWidget::RenderWidget(pGS, &mtRotate, dwStatus);
- if (CFX_DIBitmap* pDIBitmap = GetDataAcc()->GetImageImage()) {
- CFX_RectF rtImage;
- GetRectWithoutRotate(rtImage);
- if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
- XFA_RectWidthoutMargin(rtImage, mgWidget);
- }
- int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left;
- int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top;
- if (CXFA_Para para = m_pDataAcc->GetPara()) {
- iHorzAlign = para.GetHorizontalAlign();
- iVertAlign = para.GetVerticalAlign();
- }
- CXFA_Value value = m_pDataAcc->GetFormValue();
- CXFA_Image imageObj = value.GetImage();
- int32_t iAspect = imageObj.GetAspect();
- int32_t iImageXDpi = 0;
- int32_t iImageYDpi = 0;
- m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi);
- XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi,
- iImageYDpi, iHorzAlign, iVertAlign);
+
+ CFX_DIBitmap* pDIBitmap = GetDataAcc()->GetImageImage();
+ if (!pDIBitmap)
+ return;
+
+ CFX_RectF rtImage = GetRectWithoutRotate();
+ if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin())
+ XFA_RectWidthoutMargin(rtImage, mgWidget);
+
+ int32_t iHorzAlign = XFA_ATTRIBUTEENUM_Left;
+ int32_t iVertAlign = XFA_ATTRIBUTEENUM_Top;
+ if (CXFA_Para para = m_pDataAcc->GetPara()) {
+ iHorzAlign = para.GetHorizontalAlign();
+ iVertAlign = para.GetVerticalAlign();
}
+
+ CXFA_Value value = m_pDataAcc->GetFormValue();
+ CXFA_Image imageObj = value.GetImage();
+ int32_t iAspect = imageObj.GetAspect();
+ int32_t iImageXDpi = 0;
+ int32_t iImageYDpi = 0;
+ m_pDataAcc->GetImageDpi(iImageXDpi, iImageYDpi);
+ XFA_DrawImage(pGS, rtImage, &mtRotate, pDIBitmap, iAspect, iImageXDpi,
+ iImageYDpi, iHorzAlign, iVertAlign);
}