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

关于使用polyline做一个多折线画笔遇到的问题求助 #3562

Closed
dinghaining opened this issue May 5, 2023 · 3 comments
Closed
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions

Comments

@dinghaining
Copy link

Describe the bug

在做多折线画笔的时候遇到的问题,过程是这样的,points应该属于node节点xy的绝对定位,如果按照寻常的代码理解应该是直接用鼠标拖拽改变points的位置,这样就会发生node节点xy坐标默认为0的情况,Transform会出现在画布(0,0)的位置,为了解决这个问题我们将第一次鼠标点击作为xy轴初始点,后期所有拖拽点击全部新的鼠标点击减去xy轴坐标,这个时候出现了两个新的问题
1:我利用每一次点击把坐标点存储下来,xy轴最小点最大点都做出来了以后,相减做出来了宽度和高度利用resize重新赋予了node节点,可是因为是自由画笔,有可能出现polyline是负数的情况,会画到第四象限之外的位置,这样宽度高度确实是准确的,但是无法准确的包裹住node节点图形。
2:就算我完全画在第四象限,在拉大缩小的时候Transform的时候,node节点图形无法跟随框选一起拉大缩小,但是旋转是可以的,同时在同一块画布上面,我初始化直接一次性画好的节点就没有问题,可以拉大缩小旋转。
不知道以上是我配置不对还是bug,求教

Your Example Website or App

vue3.2.47 vite4.2.0

Steps to Reproduce the Bug or Issue

在做多折线画笔的时候遇到的问题,过程是这样的,points应该属于node节点xy的绝对定位,如果按照寻常的代码理解应该是直接用鼠标拖拽改变points的位置,这样就会发生node节点xy坐标默认为0的情况,Transform会出现在画布(0,0)的位置,为了解决这个问题我们将第一次鼠标点击作为xy轴初始点,后期所有拖拽点击全部新的鼠标点击减去xy轴坐标,这个时候出现了两个新的问题

Expected behavior

1:要么出一个改变Transform背景选框调整位置的api,要么出一个自适应高度位置的api
2:自定义画出来的图像也可以通过选中放大缩小

Screenshots or Videos

No response

Platform

vue 3.2.47
x6 2.9.4
vite 4.2.0

Additional context

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented May 5, 2023

👋 @dinghaining

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@NewByVector
Copy link
Contributor

如果要 polyline 节点能随着 transfrom 变化,需要将 points 属性设置成 refPoints,参考 官网示例 第一个例子。

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label May 7, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Jul 6, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jul 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: discussion 讨论 Usage questions, guidance, and other discussions
Projects
None yet
Development

No branches or pull requests

2 participants