mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 14:03:42 +02:00
Move image render functions into pages (#291)
Move image page renderes into seperate files
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
pub fn clamp_to_width(size: &mut egui::Vec2, max_width: f32) {
|
||||
let mut x = size.x;
|
||||
let mut y = size.y;
|
||||
if size.x > max_width {
|
||||
let ratio = size.y / size.x;
|
||||
x = max_width;
|
||||
y = x * ratio;
|
||||
}
|
||||
size.x = x;
|
||||
size.y = y;
|
||||
}
|
||||
Reference in New Issue
Block a user