yasmin_editor.editor_gui.window_sizing module

Helpers for sizing the main editor window against screen geometry.

class yasmin_editor.editor_gui.window_sizing.WindowRect(x: int, y: int, width: int, height: int)

Bases: object

Geometry rectangle used for initial window placement.

height: int
width: int
x: int
y: int
yasmin_editor.editor_gui.window_sizing.build_initial_window_rect(available_x: int, available_y: int, available_width: int, available_height: int, *, preferred_width: int = 1600, preferred_height: int = 950, minimum_width: int = 720, minimum_height: int = 640, margin: int = 24, width_ratio: float = 0.94, height_ratio: float = 0.92) WindowRect

Return a centered initial editor window rectangle inside the screen.

yasmin_editor.editor_gui.window_sizing.choose_preferred_screen_rect(screen_rects: Sequence[WindowRect], *, cursor_x: int | None, cursor_y: int | None, fallback_index: int = 0) WindowRect | None

Return the screen rectangle that should host the initial editor window.

The editor should open on the screen that currently contains the mouse cursor. When the cursor position is unavailable or outside all known screens, the function falls back to the window’s current screen index.

yasmin_editor.editor_gui.window_sizing.rect_contains_point(rect: WindowRect, *, x: int, y: int) bool

Return whether one global point lies inside the rectangle.