贴地svg文字偏移

This commit is contained in:
zh
2025-08-25 23:06:27 +08:00
parent 077170f2d4
commit 838f39ba40

View File

@ -376,7 +376,10 @@ class GroundSvg extends Base {
} }
set textFontSize(v) { set textFontSize(v) {
this.options.text.fontSize = v this.options.text.fontSize = v
this.text && (this.text.fontSize = v) if(this.text) {
this.text.fontSize = v
this.text.pixelOffset = v
}
this._elms.textFontSize && this._elms.textFontSize.forEach((item) => { this._elms.textFontSize && this._elms.textFontSize.forEach((item) => {
item.value = v item.value = v
}) })
@ -909,11 +912,10 @@ class GroundSvg extends Base {
text: that.options.text.value, text: that.options.text.value,
fontSize: that.options.text.fontSize, fontSize: that.options.text.fontSize,
color: that.options.text.color, color: that.options.text.color,
pixelOffset: that.options.text.pixelOffset, pixelOffset: that.options.text.fontSize,
backgroundColor: that.options.text.backgroundColor, backgroundColor: that.options.text.backgroundColor,
lineColor: that.options.text.lineColor, lineColor: '#ffffff00',
lineWidth: that.options.text.lineWidth, lineWidth: 0,
pixelOffset: 0,
scaleByDistance: that.options.text.scaleByDistance, scaleByDistance: that.options.text.scaleByDistance,
backgroundColor: ['#ffffff00', '#ffffff00'], backgroundColor: ['#ffffff00', '#ffffff00'],
near: that.options.text.near, near: that.options.text.near,