From 8221a11fe5474dbe21fb677ba026f1ab2df894cc Mon Sep 17 00:00:00 2001 From: Aidar Shaikhiev Date: Tue, 18 Jun 2024 00:23:07 +0500 Subject: [PATCH] Fixes #1761 set square dimensions for image Images rendered by veloren_voxygen::ui::graphic::renderer::draw_vox have equal width and height, because of camera settings. Needed just to set square dims for result image instead of calculating its rotated dims. --- voxygen/src/bin/img-export.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/voxygen/src/bin/img-export.rs b/voxygen/src/bin/img-export.rs index 7ef3361641..7005f92290 100644 --- a/voxygen/src/bin/img-export.rs +++ b/voxygen/src/bin/img-export.rs @@ -66,12 +66,9 @@ fn voxel_to_png(specifier: &String, transform: Transform, scale: u32, model_inde .size; let ori_mat = Mat4::from(transform.ori); let aabb_size = Vec3::new(model_size.x, model_size.y, model_size.z); - //TODO: skip dims transformation if transform is default(), instead use - // model_size - let rotated_size = calc_rotated_size(&ori_mat, &aabb_size); let projection_size = Vec2 { - x: ((rotated_size.x as u32) * scale) as u16, - y: ((rotated_size.y as u32) * scale) as u16, + x: (10u32 * scale) as u16, + y: (10u32 * scale) as u16, }; let segment = Segment::from_vox(dot_vox_data, false, model_index); let path = format!("img-export/{}.png", &specifier_to_path(specifier));