Skip to content

Conversation

@draedful
Copy link
Collaborator

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.

@draedful draedful requested a review from Antamansid as a code owner August 29, 2025 14:12
@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@draedful draedful changed the title feat: introduce interactive and non-boundary components. feat(GraphComponent, HitBox): introduce interactive and non-boundary components. Aug 29, 2025
@draedful draedful changed the title feat(GraphComponent, HitBox): introduce interactive and non-boundary components. feat(GraphComponent, HitBox): introduce interactive and non-boundary components Aug 29, 2025
if (item.affectsUsableRect) {
if (this.usableRectTracker.has(item)) {
this.usableRectTracker.update(item, bbox);
item.updateRect(bbox);
Copy link
Collaborator

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.

Copy link
Collaborator

@Antamansid Antamansid left a 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 = [];

Copy link
Collaborator

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 = false

and 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.
@draedful draedful force-pushed the hitbox-usable-rect-fix branch from 96c83dc to 9609fc4 Compare September 3, 2025 10:46
@draedful draedful merged commit ec53993 into main Sep 4, 2025
4 checks passed
@draedful draedful deleted the hitbox-usable-rect-fix branch September 4, 2025 10:22
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

Successfully merging this pull request may close these issues.

4 participants