Reducing min font size to 2; rearranging fontSizeScale logic

This commit is contained in:
notmasteryet 2012-02-13 21:12:55 -06:00
parent 99d71cc713
commit b32a7b1c8b

View File

@ -18,7 +18,7 @@ var TextRenderingMode = {
}; };
// Minimal font size that would be used during canvas fillText operations. // 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() { var CanvasExtraState = (function CanvasExtraStateClosure() {
function CanvasExtraState(old) { function CanvasExtraState(old) {
@ -721,15 +721,17 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
if (scale == 0 || lineWidth == 0) if (scale == 0 || lineWidth == 0)
lineWidth = this.getSinglePixelWidth(); lineWidth = this.getSinglePixelWidth();
else else
lineWidth /= scale * fontSizeScale; lineWidth /= scale;
ctx.lineWidth = lineWidth;
if (textSelection) if (textSelection)
text.geom = this.getTextGeometry(); text.geom = this.getTextGeometry();
if (fontSizeScale != 1.0) if (fontSizeScale != 1.0) {
ctx.scale(fontSizeScale, fontSizeScale); ctx.scale(fontSizeScale, fontSizeScale);
lineWidth /= fontSizeScale;
}
ctx.lineWidth = lineWidth;
var x = 0; var x = 0;
for (var i = 0; i < glyphsLength; ++i) { for (var i = 0; i < glyphsLength; ++i) {