File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ let kerning = require('detect-kerning')
16
16
let extend = require ( 'object-assign' )
17
17
let metrics = require ( 'font-measure' )
18
18
let flatten = require ( 'flatten-vertex-data' )
19
-
19
+ let { nextPow2 } = require ( 'bit-twiddle' )
20
20
21
21
let shaderCache = new WeakMap
22
22
@@ -596,9 +596,9 @@ class GlText {
596
596
let cols = Math . min ( maxCols , atlas . chars . length )
597
597
let rows = Math . ceil ( atlas . chars . length / cols )
598
598
599
- let atlasWidth = cols * step
599
+ let atlasWidth = nextPow2 ( cols * step )
600
600
// let atlasHeight = Math.min(rows * step + step * .5, GlText.maxAtlasSize);
601
- let atlasHeight = rows * step ;
601
+ let atlasHeight = nextPow2 ( rows * step ) ;
602
602
603
603
atlas . width = atlasWidth
604
604
atlas . height = atlasHeight ;
Original file line number Diff line number Diff line change 29
29
},
30
30
"homepage" : " https://github.com/a-vis/gl-text#readme" ,
31
31
"dependencies" : {
32
+ "bit-twiddle" : " ^1.0.2" ,
32
33
"color-normalize" : " ^1.1.0" ,
33
34
"css-font" : " ^1.2.0" ,
34
35
"detect-kerning" : " ^2.1.2" ,
You can’t perform that action at this time.
0 commit comments