From b885052d11de9b2460a93e5568f5a2bdead035fb Mon Sep 17 00:00:00 2001 From: hu de yi Date: Wed, 19 Feb 2025 15:04:13 +0800 Subject: [PATCH] round UI position css value (#2503) --- packages/maptalks/src/ui/UIComponent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/maptalks/src/ui/UIComponent.ts b/packages/maptalks/src/ui/UIComponent.ts index 0228396335..1d50192ef2 100644 --- a/packages/maptalks/src/ui/UIComponent.ts +++ b/packages/maptalks/src/ui/UIComponent.ts @@ -942,9 +942,9 @@ class UIComponent extends Eventable(Class) { if (this.options['rotateWithMap'] && bearing) { r += ` rotateZ(${Math.round(-bearing)}deg)`; } - return 'translate3d(' + Math.fround(p.x) + 'px,' + Math.fround(p.y) + 'px, 0px)' + r; + return 'translate3d(' + Math.round(p.x) + 'px,' + Math.round(p.y) + 'px, 0px)' + r; } else { - return 'translate(' + Math.fround(p.x) + 'px,' + Math.fround(p.y) + 'px)'; + return 'translate(' + Math.round(p.x) + 'px,' + Math.round(p.y) + 'px)'; } }