diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-04-24 14:05:03 -0400 |
---|---|---|
committer | dsinclair <dsinclair@chromium.org> | 2017-04-24 19:23:05 +0000 |
commit | 84213b529908d2b9095ad4c33ecc9fdf5d881df5 (patch) | |
tree | 420c17f89fdd5be1685963c5978e4fb630fdd77d | |
parent | 35e70fb57f9e4093e759d0d35b6d9b8e7800a1a3 (diff) | |
download | pdfium-chromium/3029.tar.xz |
[Merge M58] Revert "Compare to epsilon instead of 0 in CFX_Matrix::SetReverse"chromium/3029
This reverts commit fbd9ea1db2f1bb7fa006e7304a1202afc683c142.
Reason for revert: This check seems too strict
BUG=chromium:714187
Original change's description:
> Compare to epsilon instead of 0 in CFX_Matrix::SetReverse
>
> Since we are going to divide i by 0, it is better to compare it to
epsilon
> and avoid wonkiness from division by something too close to 0.
>
> BUG=chromium:702041
>
> Change-Id: I8136d6063f8debd41cef37eaab7e4097b3f32f4b
> Reviewed-on: https://pdfium-review.googlesource.com/3090
> Commit-Queue: Nicolás Peña <npm@chromium.org>
> Reviewed-by: dsinclair <dsinclair@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com
BUG=chromium:702041
Change-Id: Ia7d933fd3d8ce4957788341463866a04679d7f2b
Reviewed-on: https://pdfium-review.googlesource.com/4432
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-on: https://pdfium-review.googlesource.com/4451
Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r-- | core/fxcrt/fx_basic_coords.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fxcrt/fx_basic_coords.cpp b/core/fxcrt/fx_basic_coords.cpp index b73dc6d825..cb5a010427 100644 --- a/core/fxcrt/fx_basic_coords.cpp +++ b/core/fxcrt/fx_basic_coords.cpp @@ -4,8 +4,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include <limits.h> + #include <algorithm> -#include <limits> #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_ext.h" @@ -230,7 +231,7 @@ CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_PointF* pPoints, int nPoints) { void CFX_Matrix::SetReverse(const CFX_Matrix& m) { FX_FLOAT i = m.a * m.d - m.b * m.c; - if (FXSYS_fabs(i) <= std::numeric_limits<float>::epsilon()) + if (FXSYS_fabs(i) == 0) return; FX_FLOAT j = -i; |