diff options
author | Nicolas Pena <npm@chromium.org> | 2017-04-21 15:37:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-04-21 20:08:10 +0000 |
commit | f9f26b588e0b30fb581097e2a430f5c80f33b692 (patch) | |
tree | b313ba00d8ffe2e08d10cf22192f99915fc4d1af | |
parent | 6058730c73c78db9ec710f3b4165526acdf19e9f (diff) | |
download | pdfium-f9f26b588e0b30fb581097e2a430f5c80f33b692.tar.xz |
Revert "Compare to epsilon instead of 0 in CFX_Matrix::SetReverse"
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
# Not skipping CQ checks because original CL landed > 1 day ago.
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>
-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 f4f369a746..9c83ddfbd0 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_extension.h" @@ -230,7 +231,7 @@ CFX_FloatRect CFX_FloatRect::GetBBox(const CFX_PointF* pPoints, int nPoints) { void CFX_Matrix::SetReverse(const CFX_Matrix& m) { float i = m.a * m.d - m.b * m.c; - if (fabs(i) <= std::numeric_limits<float>::epsilon()) + if (fabs(i) == 0) return; float j = -i; |