setVisualPosition method

void setVisualPosition(
  1. Offset snappedPosition
)

Updates the visual position based on the actual position and snapping rules.

The visual position may differ from the logical position when snap-to-grid or other positioning constraints are applied. This method should be called by the graph controller when position constraints are updated.

Parameters:

  • snappedPosition - The adjusted position to use for rendering

Implementation

void setVisualPosition(Offset snappedPosition) {
  runInAction(() {
    visualPosition.value = snappedPosition;
  });
}