G6 icon indicating copy to clipboard operation
G6 copied to clipboard

V5 translateTo is wrong when zoom is not equal to 1

Open hh1412 opened this issue 4 months ago • 2 comments

Describe the bug / 问题描述

当我知道图的位置和缩放状态1 我拖拽图改变位置到状态2 当我想使用translateTo回复到状态1时 位置不对 当zoom=1时 位置回复是正常的 也就是说当 zoom不等于1时 调用translateTo 图的位置不对

https://github.com/user-attachments/assets/9025bf95-f025-42d9-9c53-6c8613f2b549

Reproduction link / 重现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

graph.zoomTo(0.5) let a = graph.getPosition() 拖拽到另一个位置 let b = graph.getPosition() graph.translateTo(a) 位置不对 https://github.com/user-attachments/assets/9025bf95-f025-42d9-9c53-6c8613f2b549

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

hh1412 avatar Sep 30 '24 01:09 hh1412