render/cursor: Don't round cursor coordinates early

This commit is contained in:
Victoria Brekenfeld 2025-04-16 19:36:15 +02:00 committed by Victoria Brekenfeld
parent e6a3f5373c
commit de1e528ba7

View file

@ -127,14 +127,13 @@ render_elements! {
pub fn draw_surface_cursor<R>( pub fn draw_surface_cursor<R>(
renderer: &mut R, renderer: &mut R,
surface: &wl_surface::WlSurface, surface: &wl_surface::WlSurface,
location: impl Into<Point<i32, Logical>>, location: Point<f64, Logical>,
scale: impl Into<Scale<f64>>, scale: impl Into<Scale<f64>>,
) -> Vec<(CursorRenderElement<R>, Point<i32, Physical>)> ) -> Vec<(CursorRenderElement<R>, Point<i32, Physical>)>
where where
R: Renderer + ImportAll, R: Renderer + ImportAll,
R::TextureId: Clone + 'static, R::TextureId: Clone + 'static,
{ {
let position = location.into();
let scale = scale.into(); let scale = scale.into();
let h = with_states(&surface, |states| { let h = with_states(&surface, |states| {
states states
@ -150,7 +149,7 @@ where
render_elements_from_surface_tree( render_elements_from_surface_tree(
renderer, renderer,
surface, surface,
position.to_physical_precise_round(scale), location.to_physical(scale).to_i32_round(),
scale, scale,
1.0, 1.0,
Kind::Cursor, Kind::Cursor,
@ -164,7 +163,7 @@ where
pub fn draw_dnd_icon<R>( pub fn draw_dnd_icon<R>(
renderer: &mut R, renderer: &mut R,
surface: &wl_surface::WlSurface, surface: &wl_surface::WlSurface,
location: impl Into<Point<i32, Logical>>, location: Point<f64, Logical>,
scale: impl Into<Scale<f64>>, scale: impl Into<Scale<f64>>,
) -> Vec<WaylandSurfaceRenderElement<R>> ) -> Vec<WaylandSurfaceRenderElement<R>>
where where
@ -181,7 +180,7 @@ where
render_elements_from_surface_tree( render_elements_from_surface_tree(
renderer, renderer,
surface, surface,
location.into().to_physical_precise_round(scale), location.to_physical(scale).to_i32_round(),
scale, scale,
1.0, 1.0,
Kind::Unspecified, Kind::Unspecified,