Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

画布scale事件有个bug #4024

Open
wtjperi2003 opened this issue Nov 10, 2023 · 1 comment
Open

画布scale事件有个bug #4024

wtjperi2003 opened this issue Nov 10, 2023 · 1 comment

Comments

@wtjperi2003
Copy link

Describe the bug

缩放的中心点(ox,oy)永远都是0.

Your Example Website or App

https://x6.antv.antgroup.com/examples/node/native-node/#text-block

Steps to Reproduce the Bug or Issue

import { Graph } from '@antv/x6'

const graph = new Graph({
  container: document.getElementById('container'),
  mousewheel:true,
  scaling:{
    min:0.1,
    max:10
  },
  grid: true,
})
graph.on('scale', (e) => {
            console.log(e)
            console.log(textNode)
textNode.prop('attrs/label/text',JSON.stringify(e));
        })

const textNode=graph.addNode({
  x: 160,
  y: 120,
  width: 360,
  height: 120,
  shape: 'text-block',
  text: `There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable.`,
  attrs: {
    body: {
      fill: '#efdbff',
      stroke: '#9254de',
      rx: 4,
      ry: 4,
    },
  },
})

鼠标滚轮转动,查看事件里的数据

Expected behavior

ox和oy.能正常返回

Screenshots or Videos

动画

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 2.11.1]

Additional context

No response

@zwying0814
Copy link

碰到了同样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants