Merge pull request #4535 from Snuffleupagus/issue-4484
Avoid drawing text when the font size is zero (issue 4484)
This commit is contained in:
commit
dc0e60d103
@ -1329,6 +1329,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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user