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

How to handle board.pointer state in react. #13

Open
pubuzhixing8 opened this issue Jul 5, 2024 · 0 comments
Open

How to handle board.pointer state in react. #13

pubuzhixing8 opened this issue Jul 5, 2024 · 0 comments

Comments

@pubuzhixing8
Copy link
Contributor

pointer 代表当前鼠标的指针状态,差不多可以对应 draw-toolbar 中工具栏的状态:hand、selection、mind、text 以及各种图形对应的 pointer 唯一值,当 board.pointer 等于 text 代表进入点击创建 text 的模式。
pointer 还有一个作用是驱动画板容器增加一个 className:pointer-${board.pointer},在 react 中直接改 board.pointer 的值无法驱动 UI 更新 className,这样的需求在 drawnix 中如何实现?

Pointer represents the current state of the mouse pointer, which roughly corresponds to the state of the toolbar in draw-toolbar: hand, selection, mind, text, and the unique pointer value corresponding to various graphics. When board.pointer equals text, it means entering the mode of clicking to create text.
Pointer also has another function, which is to drive the drawing board container to add a className: pointer-${board.pointer}. In react, directly changing the value of board.pointer cannot drive the UI to update the className. How can such a requirement be implemented in drawnix? @Xwatson @whyour

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

1 participant