Apply HiDPI to text, images, and clip primitives

Quads are a bit trickier to handle. We may need to change the shaders a
bit.
This commit is contained in:
Héctor Ramón Jiménez 2019-11-05 05:26:20 +01:00
parent 0157121038
commit db716b3bdf
6 changed files with 112 additions and 58 deletions

View file

@ -28,3 +28,16 @@ impl Rectangle<f32> {
&& point.y <= self.y + self.height
}
}
impl std::ops::Mul<f32> for Rectangle<u32> {
type Output = Self;
fn mul(self, scale: f32) -> Self {
Self {
x: (self.x as f32 * scale).round() as u32,
y: (self.y as f32 * scale).round() as u32,
width: (self.width as f32 * scale).round() as u32,
height: (self.height as f32 * scale).round() as u32,
}
}
}