Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/core/src/view/node/BaseNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export abstract class BaseNode<P extends IProps = IProps> extends Component<
allowResize,
},
gridSize,
transformModel: { SCALE_X },
transformModel,
} = graphModel
const { isHitable, draggable, transform } = model
const { className = '', ...restAttributes } = model.getOuterGAttributes()
Expand All @@ -556,7 +556,7 @@ export abstract class BaseNode<P extends IProps = IProps> extends Component<
)
} else {
if (adjustNodePosition && draggable) {
this.stepDrag.setStep(gridSize * SCALE_X)
this.stepDrag.setStep(gridSize * transformModel.SCALE_X)
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still reads the observable transformModel.SCALE_X during render(), so an observer-wrapped node view will continue to track SCALE_X and re-render on every zoom change. Switching from destructuring to transformModel.SCALE_X doesn’t avoid MobX dependency tracking; it only changes when the read occurs.

To actually prevent zoom-triggered node re-renders, avoid reading SCALE_X in render() entirely (e.g., move setStep() into handleMouseDown right before stepDrag.handleMouseDown, or wrap the read in mobx.untracked).

Copilot uses AI. Check for mistakes.
nodeShape = (
<g
Expand Down