| 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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
| 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
| 9 #include "../../include/pdfwindow/PWL_Icon.h" | 9 #include "../../include/pdfwindow/PWL_Icon.h" |
| 10 #include "../../include/pdfwindow/PWL_Utils.h" | 10 #include "../../include/pdfwindow/PWL_Utils.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 /* ------------------------------- CPWL_Icon ----------------------------------
*/ | 130 /* ------------------------------- CPWL_Icon ----------------------------------
*/ |
| 131 | 131 |
| 132 CPWL_Icon::CPWL_Icon() : m_pIconFit(NULL) | 132 CPWL_Icon::CPWL_Icon() : m_pIconFit(NULL) |
| 133 { | 133 { |
| 134 } | 134 } |
| 135 | 135 |
| 136 CPWL_Icon::~CPWL_Icon() | 136 CPWL_Icon::~CPWL_Icon() |
| 137 { | 137 { |
| 138 } | 138 } |
| 139 | 139 |
| 140 FX_INT32 CPWL_Icon::GetScaleMethod() | 140 int32_t CPWL_Icon::GetScaleMethod() |
| 141 { | 141 { |
| 142 if (m_pIconFit) | 142 if (m_pIconFit) |
| 143 return m_pIconFit->GetScaleMethod(); | 143 return m_pIconFit->GetScaleMethod(); |
| 144 | 144 |
| 145 return 0; | 145 return 0; |
| 146 } | 146 } |
| 147 | 147 |
| 148 FX_BOOL CPWL_Icon::IsProportionalScale() | 148 FX_BOOL CPWL_Icon::IsProportionalScale() |
| 149 { | 149 { |
| 150 if (m_pIconFit) | 150 if (m_pIconFit) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 { | 192 { |
| 193 FX_FLOAT fImageWidth,fImageHeight; | 193 FX_FLOAT fImageWidth,fImageHeight; |
| 194 FX_FLOAT fPlateWidth,fPlateHeight; | 194 FX_FLOAT fPlateWidth,fPlateHeight; |
| 195 | 195 |
| 196 CPDF_Rect rcPlate = this->GetClientRect(); | 196 CPDF_Rect rcPlate = this->GetClientRect(); |
| 197 fPlateWidth = rcPlate.right - rcPlate.left; | 197 fPlateWidth = rcPlate.right - rcPlate.left; |
| 198 fPlateHeight = rcPlate.top - rcPlate.bottom; | 198 fPlateHeight = rcPlate.top - rcPlate.bottom; |
| 199 | 199 |
| 200 GetImageSize(fImageWidth,fImageHeight); | 200 GetImageSize(fImageWidth,fImageHeight); |
| 201 | 201 |
| 202 » » FX_INT32 nScaleMethod = this->GetScaleMethod(); | 202 » » int32_t nScaleMethod = this->GetScaleMethod(); |
| 203 | 203 |
| 204 /* | 204 /* |
| 205 enum ScaleMethod | 205 enum ScaleMethod |
| 206 { | 206 { |
| 207 Always = 0, //A, Always scale | 207 Always = 0, //A, Always scale |
| 208 Bigger, //B, Scale only when the icon is bigger
than the annotation rectangle | 208 Bigger, //B, Scale only when the icon is bigger
than the annotation rectangle |
| 209 Smaller, //S, Scale only when the icon is smaller
then the annotation rectangle | 209 Smaller, //S, Scale only when the icon is smaller
then the annotation rectangle |
| 210 Never //N, Never scale | 210 Never //N, Never scale |
| 211 }; | 211 }; |
| 212 */ | 212 */ |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 FX_FLOAT fPlateWidth,fPlateHeight; | 264 FX_FLOAT fPlateWidth,fPlateHeight; |
| 265 CPDF_Rect rcPlate = this->GetClientRect(); | 265 CPDF_Rect rcPlate = this->GetClientRect(); |
| 266 fPlateWidth = rcPlate.right - rcPlate.left; | 266 fPlateWidth = rcPlate.right - rcPlate.left; |
| 267 fPlateHeight = rcPlate.top - rcPlate.bottom; | 267 fPlateHeight = rcPlate.top - rcPlate.bottom; |
| 268 | 268 |
| 269 x = (fPlateWidth - fImageFactWidth) * fLeft; | 269 x = (fPlateWidth - fImageFactWidth) * fLeft; |
| 270 y = (fPlateHeight - fImageFactHeight) * fBottom; | 270 y = (fPlateHeight - fImageFactHeight) * fBottom; |
| 271 } | 271 } |
| 272 | 272 |
| OLD | NEW |