Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDimensions = errors.New("invalid dimensions: negative width or height")
ErrInvalidDimensions is returned when a window or monitor has negative dimensions
var ErrNoMonitors = errors.New("no monitors available")
ErrNoMonitors is returned when no monitors are available for fitting
Functions ¶
func ContainsLogicalPoint ¶
ContainsLogicalPoint checks if a logical point is within the monitor's logical bounds
func ContainsPhysicalPoint ¶
ContainsPhysicalPoint checks if a physical point is within the monitor's physical bounds
Types ¶
type Monitor ¶
Monitor represents a display monitor and its properties
func FindMonitorFromLogicalPoint ¶
FindMonitorFromLogicalPoint finds the monitor that contains the given logical point
func FindMonitorFromLogicalRect ¶
FindMonitorFromLogicalRect finds a monitor with the largest overlap with the given rect
func FindMonitorFromPhysicalPoint ¶
FindMonitorFromPhysicalPoint finds the monitor that contains the given physical point
type Rect ¶
Rect represents a rectangle with coordinates in screen space
func FitToMonitor ¶
FitToMonitor fits a window to a specific monitor. All coordinates are in logical space. Returns error if window or monitor has negative dimensions.
func FitToNearestMonitor ¶
func FitToNearestMonitor(monitors []Monitor, mode FitMode, window Rect, minWidth, minHeight int) (Rect, error)
FitToNearestMonitor finds the most appropriate monitor and fits the window to it. If minWidth and minHeight are > 0, it will try to find a monitor that can fit these minimum dimensions. Returns error if window has negative dimensions or if no valid monitors are available.
func LogicalToPhysical ¶
LogicalToPhysical converts logical coordinates to physical coordinates for a given monitor
func PhysicalToLogical ¶
PhysicalToLogical converts physical coordinates to logical coordinates for a given monitor