fix: one pixel gap between outputs due to rounding error

This commit is contained in:
Hojjat 2026-07-27 14:40:34 -06:00 • committed by Michael Murphy
parent 4841c87622
commit 25cc9ef31b

View file

@ -244,11 +244,13 @@ impl<Message: Clone> Widget<Message, cosmic::Theme, Renderer> for Arrangement<'_
if let Some(ref on_placement) = self.on_placement {
shell.publish(on_placement(
output_key,
((region.x - state.max_dimensions.0 - bounds.x) * UNIT_PIXELS) as i32,
((region.x - state.max_dimensions.0 - bounds.x) * UNIT_PIXELS).round()
as i32,
((region.y
- (state.max_dimensions.1 / VERTICAL_DISPLAY_OVERHEAD)
- bounds.y)
* UNIT_PIXELS) as i32,
* UNIT_PIXELS)
.round() as i32,
));
}