render: don't warn when rendering an unmapped sub-surface
This commit is contained in:
parent
3d7bf39737
commit
daf03b423d
2 changed files with 13 additions and 3 deletions
|
|
@ -76,7 +76,15 @@ impl Cursor for CursorSurface {
|
||||||
let (hot_x, hot_y) = (Fixed::from_int(hot_x), Fixed::from_int(hot_y));
|
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 x = ((x - hot_x).to_f64() * scale).round() as _;
|
||||||
let y = ((y - hot_y).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);
|
renderer.render_surface_scaled(
|
||||||
|
&self.surface,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
None,
|
||||||
|
i32::MAX,
|
||||||
|
i32::MAX,
|
||||||
|
false,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
renderer.render_surface(
|
renderer.render_surface(
|
||||||
&self.surface,
|
&self.surface,
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ impl Renderer<'_> {
|
||||||
max_height: i32,
|
max_height: i32,
|
||||||
) {
|
) {
|
||||||
let (x, y) = self.base.scale_point(x, y);
|
let (x, y) = self.base.scale_point(x, y);
|
||||||
self.render_surface_scaled(surface, x, y, None, max_width, max_height);
|
self.render_surface_scaled(surface, x, y, None, max_width, max_height, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_surface_scaled(
|
pub fn render_surface_scaled(
|
||||||
|
|
@ -318,12 +318,13 @@ impl Renderer<'_> {
|
||||||
pos_rel: Option<(i32, i32)>,
|
pos_rel: Option<(i32, i32)>,
|
||||||
max_width: i32,
|
max_width: i32,
|
||||||
max_height: i32,
|
max_height: i32,
|
||||||
|
is_subsurface: bool,
|
||||||
) {
|
) {
|
||||||
let children = surface.children.borrow();
|
let children = surface.children.borrow();
|
||||||
let buffer = match surface.buffer.get() {
|
let buffer = match surface.buffer.get() {
|
||||||
Some(b) => b,
|
Some(b) => b,
|
||||||
_ => {
|
_ => {
|
||||||
if !surface.is_cursor() {
|
if !surface.is_cursor() && !is_subsurface {
|
||||||
log::warn!("surface has no buffer attached");
|
log::warn!("surface has no buffer attached");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -354,6 +355,7 @@ impl Renderer<'_> {
|
||||||
Some((pos.x1(), pos.y1())),
|
Some((pos.x1(), pos.y1())),
|
||||||
max_width,
|
max_width,
|
||||||
max_height,
|
max_height,
|
||||||
|
true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue