[Pkg-javascript-commits] [pdf.js] 07/141: Avoid drawing text when the font size is zero (issue 4484)

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 22:40:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 08eb9a960adc7cbd8eda74ae89135f915a55cc25
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Mar 30 13:36:21 2014 +0200

    Avoid drawing text when the font size is zero (issue 4484)
---
 src/display/canvas.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/display/canvas.js b/src/display/canvas.js
index bcb8516..74a100c 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -1322,6 +1322,19 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
       var vertical = font.vertical;
       var defaultVMetrics = font.defaultVMetrics;
 
+      if (fontSize === 0) {
+        if (textSelection) {
+          geom = this.createTextGeometry();
+          geom.canvasWidth = canvasWidth;
+          if (vertical) {
+            var VERTICAL_TEXT_ROTATION = Math.PI / 2;
+            geom.angle += VERTICAL_TEXT_ROTATION;
+          }
+          this.textLayer.appendText(geom);
+        }
+        return canvasWidth;
+      }
+
       // Type3 fonts - each glyph is a "mini-PDF"
       if (font.coded) {
         ctx.save();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list