From b32a7b1c8ba4fc9feeb60cbbe325a5f210d45b03 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Mon, 13 Feb 2012 21:12:55 -0600 Subject: [PATCH] Reducing min font size to 2; rearranging fontSizeScale logic --- src/canvas.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 1a2ff3951..9952d7b1f 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -18,7 +18,7 @@ var TextRenderingMode = { }; // Minimal font size that would be used during canvas fillText operations. -var MIN_FONT_SIZE = 8; +var MIN_FONT_SIZE = 2; var CanvasExtraState = (function CanvasExtraStateClosure() { function CanvasExtraState(old) { @@ -721,15 +721,17 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (scale == 0 || lineWidth == 0) lineWidth = this.getSinglePixelWidth(); else - lineWidth /= scale * fontSizeScale; - - ctx.lineWidth = lineWidth; + lineWidth /= scale; if (textSelection) text.geom = this.getTextGeometry(); - if (fontSizeScale != 1.0) + if (fontSizeScale != 1.0) { ctx.scale(fontSizeScale, fontSizeScale); + lineWidth /= fontSizeScale; + } + + ctx.lineWidth = lineWidth; var x = 0; for (var i = 0; i < glyphsLength; ++i) {