render: Fix cursor rendering on empty screens
This commit is contained in:
parent
06c972c989
commit
6c7b393b79
1 changed files with 7 additions and 2 deletions
|
|
@ -209,8 +209,9 @@ where
|
||||||
_: Option<SpaceOutputTuple<'_, '_>>,
|
_: Option<SpaceOutputTuple<'_, '_>>,
|
||||||
) -> Vec<Rectangle<i32, Physical>> {
|
) -> Vec<Rectangle<i32, Physical>> {
|
||||||
if self.new_frame {
|
if self.new_frame {
|
||||||
|
let scale = scale.into();
|
||||||
vec![Rectangle::from_loc_and_size(
|
vec![Rectangle::from_loc_and_size(
|
||||||
(0, 0),
|
self.position.to_physical(scale).to_i32_round(),
|
||||||
self.size.to_physical_precise_round(scale),
|
self.size.to_physical_precise_round(scale),
|
||||||
)]
|
)]
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -234,13 +235,17 @@ where
|
||||||
damage: &[Rectangle<i32, Physical>],
|
damage: &[Rectangle<i32, Physical>],
|
||||||
_log: &slog::Logger,
|
_log: &slog::Logger,
|
||||||
) -> Result<(), <R as Renderer>::Error> {
|
) -> Result<(), <R as Renderer>::Error> {
|
||||||
|
let scale = scale.into();
|
||||||
frame.render_texture_at(
|
frame.render_texture_at(
|
||||||
&self.texture,
|
&self.texture,
|
||||||
position.to_i32_round(),
|
position.to_i32_round(),
|
||||||
1,
|
1,
|
||||||
scale,
|
scale,
|
||||||
Transform::Normal,
|
Transform::Normal,
|
||||||
damage,
|
&damage.iter().copied().map(|mut rect| {
|
||||||
|
rect.loc -= self.position.to_physical(scale).to_i32_round();
|
||||||
|
rect
|
||||||
|
}).collect::<Vec<_>>(),
|
||||||
1.0,
|
1.0,
|
||||||
)?;
|
)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue