render: fix top-left clipping of surfaces
This commit is contained in:
parent
ccacdda03e
commit
250026f7f6
18 changed files with 147 additions and 277 deletions
|
|
@ -76,36 +76,16 @@ impl Cursor for CursorSurface {
|
|||
let (hot_x, hot_y) = (Fixed::from_int(hot_x), Fixed::from_int(hot_y));
|
||||
let x = ((x - hot_x).to_f64() * scale).round() as _;
|
||||
let y = ((y - hot_y).to_f64() * scale).round() as _;
|
||||
renderer.render_surface_scaled(
|
||||
&self.surface,
|
||||
x,
|
||||
y,
|
||||
None,
|
||||
i32::MAX,
|
||||
i32::MAX,
|
||||
false,
|
||||
);
|
||||
renderer.render_surface_scaled(&self.surface, x, y, None, None, false);
|
||||
} else {
|
||||
renderer.render_surface(
|
||||
&self.surface,
|
||||
x_int - hot_x,
|
||||
y_int - hot_y,
|
||||
i32::MAX,
|
||||
i32::MAX,
|
||||
);
|
||||
renderer.render_surface(&self.surface, x_int - hot_x, y_int - hot_y, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn render_hardware_cursor(&self, renderer: &mut Renderer) {
|
||||
let extents = self.surface.extents.get();
|
||||
renderer.render_surface(
|
||||
&self.surface,
|
||||
-extents.x1(),
|
||||
-extents.y1(),
|
||||
i32::MAX,
|
||||
i32::MAX,
|
||||
);
|
||||
renderer.render_surface(&self.surface, -extents.x1(), -extents.y1(), None);
|
||||
|
||||
struct FrameRequests;
|
||||
impl NodeVisitorBase for FrameRequests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue