yasmin_editor.editor_gui.free_position module

Pure helper for selecting a free scene position near the viewport center.

yasmin_editor.editor_gui.free_position.fallback_position(center: tuple[float, float], occupied_count: int, *, spacing_x: float, spacing_y: float) tuple[float, float]

Return a deterministic overflow slot when the search ring is saturated.

yasmin_editor.editor_gui.free_position.find_free_position(center: tuple[float, float], occupied_positions: list[tuple[float, float]], *, spacing_x: float = 180.0, spacing_y: float = 130.0, radius_limit: int = 5) tuple[float, float]

Return a free grid slot near the visible center.

Candidates are scanned in expanding square rings around the viewport center. When no free slot is found inside the search radius, the helper falls back to a deterministic overflow grid so newly created items still land in a stable location.

yasmin_editor.editor_gui.free_position.is_position_free(candidate: tuple[float, float], occupied_positions: list[tuple[float, float]], *, spacing_x: float, spacing_y: float) bool

Return whether one candidate is far enough away from existing items.

yasmin_editor.editor_gui.free_position.iter_candidate_positions(center: tuple[float, float], *, spacing_x: float, spacing_y: float, radius_limit: int) list[tuple[float, float]]

Return candidate positions in the same ring order used by the editor.