Skip to content

画布scale事件有个bug #4024

@wtjperi2003

Description

@wtjperi2003

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't workinggood first issueGood for newcomers.oscpThis issue is related to the OSCP (Open Source Contribution Plan)

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions