Minor cleanup to Render size
This commit is contained in:
@@ -62,12 +62,13 @@ struct RenderSteps<'a> {
|
||||
|
||||
impl<'a> RenderSteps<'a> {
|
||||
fn render(state: &'a dyn GenericSim, measurements: &'a [Box<dyn AbstractMeasurement>], z: u32) -> RgbImage {
|
||||
let mut width = 1920;
|
||||
let mut width = 640;
|
||||
let max_height = 480;
|
||||
let mut height = width * state.height() / state.width();
|
||||
if height > 1080 {
|
||||
let stretch = 1080 as f32 / height as f32;
|
||||
if height > max_height {
|
||||
let stretch = max_height as f32 / height as f32;
|
||||
width = (width as f32 * stretch) as _;
|
||||
height = 1080;
|
||||
height = max_height;
|
||||
}
|
||||
trace!("rendering at {}x{}", width, height);
|
||||
let mut me = Self::new(state, measurements, width, height, z);
|
||||
|
Reference in New Issue
Block a user