File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/browser/renderer/shared Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -429,12 +429,12 @@ export class TextureAtlas implements ITextureAtlas {
429429 // Allow 1 cell width per character, with a minimum of 2 (CJK), plus some padding. This is used
430430 // to draw the glyph to the canvas as well as to restrict the bounding box search to ensure
431431 // giant ligatures (eg. =====>) don't impact overall performance.
432- const allowedWidth = this . _config . deviceCellWidth * Math . max ( chars . length , 2 ) + TMP_CANVAS_GLYPH_PADDING * 2 ;
432+ const allowedWidth = Math . min ( this . _config . deviceCellWidth * Math . max ( chars . length , 2 ) + TMP_CANVAS_GLYPH_PADDING * 2 , this . _textureSize ) ;
433433 if ( this . _tmpCanvas . width < allowedWidth ) {
434434 this . _tmpCanvas . width = allowedWidth ;
435435 }
436436 // Include line height when drawing glyphs
437- const allowedHeight = this . _config . deviceCellHeight + TMP_CANVAS_GLYPH_PADDING * 4 ;
437+ const allowedHeight = Math . min ( this . _config . deviceCellHeight + TMP_CANVAS_GLYPH_PADDING * 4 , this . _textureSize ) ;
438438 if ( this . _tmpCanvas . height < allowedHeight ) {
439439 this . _tmpCanvas . height = allowedHeight ;
440440 }
You can’t perform that action at this time.
0 commit comments