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:
parent
0157121038
commit
db716b3bdf
6 changed files with 112 additions and 58 deletions
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue