File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
packages/display/src/displays/webgl/buffer Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,15 @@ import {TextStyle} from '@here/xyz-maps-core';
25
25
const EXTENT_SCALE = 64 ;
26
26
27
27
const ANCHOR_OFFSET : Record < TextStyle [ 'textAnchor' ] , { x : number , y : number } > = {
28
- Center : { x : .5 , y : 0 } ,
29
- Left : { x : 0 , y : 0 } ,
30
- Right : { x : 1 , y : 0 } ,
31
- Top : { x : .5 , y : - 1 } ,
32
- TopLeft : { x : 0 , y : - 1 } ,
33
- TopRight : { x : 1 , y : - 1 } ,
34
- Bottom : { x : .5 , y : 1 } ,
35
- BottomLeft : { x : 0 , y : 1 } ,
36
- BottomRight : { x : 1 , y : 1 }
28
+ Center : { x : .5 , y : 1 } ,
29
+ Left : { x : 0 , y : 1 } ,
30
+ Right : { x : 1 , y : 1 } ,
31
+ Top : { x : .5 , y : 0 } ,
32
+ TopLeft : { x : 0 , y : 0 } ,
33
+ TopRight : { x : 1 , y : 0 } ,
34
+ Bottom : { x : .5 , y : 2 } ,
35
+ BottomLeft : { x : 0 , y : 2 } ,
36
+ BottomRight : { x : 1 , y : 2 }
37
37
} ;
38
38
39
39
const addText = (
@@ -52,7 +52,7 @@ const addText = (
52
52
const lineOffset = lines . length - 1 ;
53
53
const lineHeight = glyphAtlas . lineHeight ;
54
54
const anchorOffset = ANCHOR_OFFSET [ textAnchor ] || ANCHOR_OFFSET . Center ;
55
- let ty = ( glyphAtlas . baselineOffset + lineHeight * ( lineOffset * .5 + anchorOffset . y * ( lineOffset || 1 ) ) ) * OFFSET_SCALE ;
55
+ let ty = ( glyphAtlas . baselineOffset + lineHeight * lineOffset * .5 ) * OFFSET_SCALE * anchorOffset . y ;
56
56
57
57
// LSB defines visibility, visible by default
58
58
cx = cx * EXTENT_SCALE << 1 | 1 ;
You can’t perform that action at this time.
0 commit comments