-
Notifications
You must be signed in to change notification settings - Fork 7
feat(GraphComponent, HitBox): introduce interactive and non-boundary components #130
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
Conversation
|
Preview is ready. |
src/services/HitTest.ts
Outdated
| if (item.affectsUsableRect) { | ||
| if (this.usableRectTracker.has(item)) { | ||
| this.usableRectTracker.update(item, bbox); | ||
| item.updateRect(bbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinkupdateRect can be deleted from 104 and 106 row, anyway, it's already being done on 112 row. Now, as I understand, updateRect happens twice.
Antamansid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works perfect!
| () => { | ||
| const items = []; | ||
| const interactiveItems = []; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should here check like:
let shouldUpdateUsableRect = falseand here on 102 line:
if (item.affectsUsableRect) {
shouldUpdateUsableRect = true
...this is because this.updateUsableRect always returns a new object, which causes the positions of the blocks whose positions depend on usabelRect to change.
Or deepEqual updateUsableRect value always before update it
Interactive components are components that can be interacted with. (GraphComponent props {interactive: true})
Non-boundary components are components that are not affected by the usable rect. (GraphComponent props {affectsUsableRect: false})
Non-boundary components are useful when you need to position component outside of the usable rect.
96c83dc to
9609fc4
Compare
Interactive components are components that can be interacted with. (GraphComponent props {interactive: true})
Non-boundary components are components that are not affected by the usable rect. (GraphComponent props {affectsUsableRect: false})
Non-boundary components are useful when you need to position component outside of the usable rect.