diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-01-19 19:45:28 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-19 19:45:28 +0000 |
commit | ebf965adeb93cf5612291ae69c3986526394b354 (patch) | |
tree | 45944027b8d97c500937d6136f4ca697104232ad /core/fxcrt/fx_coordinates.cpp | |
parent | f668ed47ae5472e903ba79499cbff39927155ae2 (diff) | |
download | pdfium-ebf965adeb93cf5612291ae69c3986526394b354.tar.xz |
Fix CFX_Matrix.RotateAt()
The translations were in the opposite order they should be.
First the specified (x, y) coord needs to be translated to the
origin, then rotation should be applied, then the translation should
be reversed. To translate (x, y) to the origin, the initial
translation should be Tx = -x, Ty = -y.
Bug: pdfium:987
Change-Id: I7f873c6a20858bf7fd03e5fdb49020b196b44a1d
Reviewed-on: https://pdfium-review.googlesource.com/23210
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Shirleen Lou <xlou@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_coordinates.cpp')
-rw-r--r-- | core/fxcrt/fx_coordinates.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcrt/fx_coordinates.cpp b/core/fxcrt/fx_coordinates.cpp index ac13a32329..69fedb5522 100644 --- a/core/fxcrt/fx_coordinates.cpp +++ b/core/fxcrt/fx_coordinates.cpp @@ -271,10 +271,10 @@ void CFX_Matrix::Rotate(float fRadian, bool bPrepended) { bPrepended); } -void CFX_Matrix::RotateAt(float fRadian, float dx, float dy, bool bPrepended) { - Translate(dx, dy, bPrepended); +void CFX_Matrix::RotateAt(float fRadian, float x, float y, bool bPrepended) { + Translate(-x, -y, bPrepended); Rotate(fRadian, bPrepended); - Translate(-dx, -dy, bPrepended); + Translate(x, y, bPrepended); } void CFX_Matrix::Shear(float fAlphaRadian, float fBetaRadian, bool bPrepended) { |