-
Notifications
You must be signed in to change notification settings - Fork 245
Use Controls to implement node resizing #393
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
base: develop
Are you sure you want to change the base?
Use Controls to implement node resizing #393
Conversation
* add test * add fix * enable zoom for testing * finish writing tests * add fix for remaining resizers * Revert "enable zoom for testing" This reverts commit 69fa0aa. * fix formatting * make fields nullable * fix nullables * use file scoped namespaces
e337190
to
920dc36
Compare
When can we expect merge this feature to develop? |
I don`t think it must be part of core. There is 2 reasons.
@zHaytam am I right? |
Hey, any updates on Node Resizing feature? |
You make a lot of good points to be honest. The thing is, your provider is handling the resizing and setting the size, and the renderer sets the CSS width/height, but the assumption of the whole library is that sizes change based on content, that's why we use a resize observer to capture changes.
|
Having dynamic nodes VS static/controlled nodes would also make it possible to have a set of known nodes/shapes that you often see in other libraries as static/controlled and do a lot of things, so maybe that's worth working on, what do you guys think? |
I just looked at doing this myself or using this solution, and here is my conclusion: I tried a few things. I expect adding a little interceptor (see below) to intercept the events should work. But I'm not quite there.
|
I have added a
ResizeControl
which is anExecutableControl
and has anIResizerProvider
. EachResizeControl
added to a node adds a 'resizer' which is by default, a small box at the corner of the node. When the resizer is dragged, the node resizes.IResizeProvider
provides the position of the resizer and also the behavior for the node when the resizer is dragged. I have included four default implementations ofIResizeProvider
- one for each corner of a node.