diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-03-21 13:51:35 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-21 13:51:35 +0000 |
commit | a17ac192c043a6bce51e16cf7cd076087c78d9a9 (patch) | |
tree | ada8a1cf8d265d69bef1ad94901990da3b3f9c64 /core/fpdfapi/page | |
parent | c3cffbedb5ff83afa4fde51e98509f915997ff4a (diff) | |
download | pdfium-a17ac192c043a6bce51e16cf7cd076087c78d9a9.tar.xz |
Explain how CPDF_Page::GetDisplayMatrix() inverts y.
Change-Id: Ia6e9fe790065d0bfd288d425c10d1dd9e0cf8c31
Reviewed-on: https://pdfium-review.googlesource.com/28850
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_page.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp index 0c8d63de71..6518d80aa3 100644 --- a/core/fpdfapi/page/cpdf_page.cpp +++ b/core/fpdfapi/page/cpdf_page.cpp @@ -133,6 +133,12 @@ CFX_Matrix CPDF_Page::GetDisplayMatrix(int xPos, float x2 = 0; float y2 = 0; iRotate %= 4; + // This code implicitly inverts the y-axis to account for page coordinates + // pointing up and bitmap coordinates pointing down. (x0, y0) is the base + // point, (x1, y1) is that point translated on y and (x2, y2) is the point + // translated on x. On iRotate = 0, y0 is (yPos + ySize) and the translation + // to get y1 is performed as negative. This results in the desired + // transformation. switch (iRotate) { case 0: x0 = xPos; |