setVisualPosition method

void setVisualPosition(
  1. Offset snappedPosition
)

Updates the visual position (used for rendering with grid snapping).

This is called by the framework to set the snapped position that's actually rendered on screen. This should match node behavior exactly for consistent grid alignment.

Generally, you don't need to call this directly - the framework handles it automatically when you call setPosition.

Implementation

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