提交 dfb58adc 编写于 作者: 1 100pah

fix: label should only apply the translate of this host el.

上级 ad3d4332
......@@ -575,16 +575,13 @@ class MapDraw {
};
function labelTextAfterUpdate(this: graphic.Text) {
// Make the label text do not scale but perform translate
// based on its host el.
const m = this.transform;
const scaleX = Math.sqrt(m[0] * m[0] + m[1] * m[1]);
const scaleY = Math.sqrt(m[2] * m[2] + m[3] * m[3]);
m[0] /= scaleX;
m[1] /= scaleX;
m[2] /= scaleY;
m[3] /= scaleY;
// Make the label text apply only translate of this host el
// but no other transform like scale,rotation of this host el.
const mt = this.transform;
mt[0] = 1;
mt[1] = 0;
mt[2] = 0;
mt[3] = 1;
}
function applyOptionStyleForRegion(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册