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 "core/include/fxge/fx_ge.h" | 7 #include "core/include/fxge/fx_ge.h" |
8 | 8 |
9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ | 9 #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_DESKTOP_ |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 int pair1 = pairs[i * 2]; | 1080 int pair1 = pairs[i * 2]; |
1081 int pair2 = pairs[i * 2 + 1]; | 1081 int pair2 = pairs[i * 2 + 1]; |
1082 FX_FLOAT x1 = points[pair1].X, x2 = points[pair2].X; | 1082 FX_FLOAT x1 = points[pair1].X, x2 = points[pair2].X; |
1083 FX_FLOAT y1 = points[pair1].Y, y2 = points[pair2].Y; | 1083 FX_FLOAT y1 = points[pair1].Y, y2 = points[pair2].Y; |
1084 if (pMatrix) { | 1084 if (pMatrix) { |
1085 pMatrix->Transform(x1, y1); | 1085 pMatrix->Transform(x1, y1); |
1086 pMatrix->Transform(x2, y2); | 1086 pMatrix->Transform(x2, y2); |
1087 } | 1087 } |
1088 FX_FLOAT dx = x1 - x2; | 1088 FX_FLOAT dx = x1 - x2; |
1089 FX_FLOAT dy = y1 - y2; | 1089 FX_FLOAT dy = y1 - y2; |
1090 FX_FLOAT distance_square = FXSYS_Mul(dx, dx) + FXSYS_Mul(dy, dy); | 1090 FX_FLOAT distance_square = (dx * dx) + (dy * dy); |
1091 if (distance_square < (1.0f * 2 + 1.0f / 4)) { | 1091 if (distance_square < (1.0f * 2 + 1.0f / 4)) { |
1092 v1 = i; | 1092 v1 = i; |
1093 v2 = pair1; | 1093 v2 = pair1; |
1094 return TRUE; | 1094 return TRUE; |
1095 } | 1095 } |
1096 } | 1096 } |
1097 return FALSE; | 1097 return FALSE; |
1098 } | 1098 } |
1099 FX_BOOL CGdiplusExt::DrawPath(HDC hDC, | 1099 FX_BOOL CGdiplusExt::DrawPath(HDC hDC, |
1100 const CFX_PathData* pPathData, | 1100 const CFX_PathData* pPathData, |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 dest_pitch); | 1507 dest_pitch); |
1508 } | 1508 } |
1509 } | 1509 } |
1510 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( | 1510 CFX_DIBitmap* pDIBitmap = _FX_WindowsDIB_LoadFromBuf( |
1511 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); | 1511 pInfo->pbmi, pData, pInfo->pbmi->bmiHeader.biBitCount == 32); |
1512 FX_Free(pData); | 1512 FX_Free(pData); |
1513 FreeDIBitmap(pInfo); | 1513 FreeDIBitmap(pInfo); |
1514 return pDIBitmap; | 1514 return pDIBitmap; |
1515 } | 1515 } |
1516 #endif | 1516 #endif |
OLD | NEW |