Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorCompositor::GeometryHelpers Namespace Reference

Compositor-agnostic geometry helper utilities. More...

Functions

QRect snapToRect (const QRectF &rf)
 Convert QRectF to QRect with edge-consistent rounding.
 

Detailed Description

Compositor-agnostic geometry helper utilities.

Shared geometry functions used by all compositor plugins.

Function Documentation

◆ snapToRect()

QRect PhosphorCompositor::GeometryHelpers::snapToRect ( const QRectF &  rf)
inline

Convert QRectF to QRect with edge-consistent rounding.

Unlike QRectF::toRect() which rounds x, y, width, height independently, this rounds the edges (left, top, right, bottom) and derives width/height from the rounded edges. This ensures adjacent zones sharing an edge always produce exactly the configured gap between them, even when fractional scaling (e.g. 1.2x) produces non-integer zone boundaries.