Skip to content

Commit 006e403

Browse files
authored
Merge pull request #2 from gl-vis/pass-text-align-opts
Pass text align opts
2 parents 7238c92 + ff0cd57 commit 006e403

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "text-cache",
3-
"version": "4.0.0",
3+
"version": "4.1.0",
44
"description": "Internal module - vectorized text pooling for gl-vis",
55
"main": "textcache.js",
66
"directories": {

textcache.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function unwrap(mesh) {
2929
}
3030
}
3131

32-
function textGet(font, text) {
32+
function textGet(font, text, opts) {
33+
var opts = opts || {}
3334
var fontcache = __TEXT_CACHE[font]
3435
if(!fontcache) {
3536
fontcache = __TEXT_CACHE[font] = {
@@ -45,7 +46,7 @@ function textGet(font, text) {
4546
mesh = fontcache[text] = unwrap(vectorizeText(text, {
4647
triangles: true,
4748
font: font,
48-
textAlign: 'left',
49+
textAlign: opts.textAlign || 'left',
4950
textBaseline: 'alphabetic'
5051
}))
5152
} else {

0 commit comments

Comments
 (0)