From f9f26b588e0b30fb581097e2a430f5c80f33b692 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Fri, 21 Apr 2017 15:37:42 -0400 Subject: 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 # 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 Reviewed-by: Tom Sepez Commit-Queue: Nicolás Peña --- 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 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 + #include -#include #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::epsilon()) + if (fabs(i) == 0) return; float j = -i; -- cgit v1.2.3