-
Notifications
You must be signed in to change notification settings - Fork 98
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
怎么捕获属性x,y的变化? #306
Comments
通过 PropertyEvent 事件监听x,y属性的变化, 再同步给dom元素。 或者去看一下text-editor插件,里面也用到了dom同步的功能。 |
监听元素,不是监听editor |
text-editor是一个非常好的dom同步方案,已经采用与text-editor同样的方案来做dom同步。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
最近想同步dom元素和canvas元素的位置,在拖动的时候发现leafer-x-snap会造成dom元素canvas对应元素的位置不一致,发现leafer-x-snap吸附元素的时候直接使用了类似
item.x = item.x - snapXInfo.offset
这样的语句而造成EditorMoveEvent
、``没触发,PropertyEvent
触发了,但是数据是undefined,后来想个办法是继承`Rect`,重写`set x set y`,也没有生效。我该如何同步两个元素的位置呢?准备做一个能显示gif图像的设计面板The text was updated successfully, but these errors were encountered: