From 84213b529908d2b9095ad4c33ecc9fdf5d881df5 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 24 Apr 2017 14:05:03 -0400 Subject: [Merge M58] Revert "Compare to epsilon instead of 0 in CFX_Matrix::SetReverse" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 > Reviewed-by: dsinclair > 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 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña Reviewed-on: https://pdfium-review.googlesource.com/4451 Reviewed-by: dsinclair --- core/fxcrt/fx_basic_coords.cpp | 5 +++-- 1 file 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 + #include -#include #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::epsilon()) + if (FXSYS_fabs(i) == 0) return; FX_FLOAT j = -i; -- cgit v1.2.3