fix: one pixel gap between outputs due to rounding error
This commit is contained in:
parent
4841c87622
commit
25cc9ef31b
1 changed files with 4 additions and 2 deletions
|
|
@ -244,11 +244,13 @@ impl<Message: Clone> Widget<Message, cosmic::Theme, Renderer> for Arrangement<'_
|
||||||
if let Some(ref on_placement) = self.on_placement {
|
if let Some(ref on_placement) = self.on_placement {
|
||||||
shell.publish(on_placement(
|
shell.publish(on_placement(
|
||||||
output_key,
|
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
|
((region.y
|
||||||
- (state.max_dimensions.1 / VERTICAL_DISPLAY_OVERHEAD)
|
- (state.max_dimensions.1 / VERTICAL_DISPLAY_OVERHEAD)
|
||||||
- bounds.y)
|
- bounds.y)
|
||||||
* UNIT_PIXELS) as i32,
|
* UNIT_PIXELS)
|
||||||
|
.round() as i32,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue