From 224e9618f735f1215030cbf4f0b2b289a98a3bc7 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sun, 21 Feb 2021 10:35:33 +0100 Subject: [PATCH] Fix #758 Incorrect resolutions in faceUV templates --- js/texturing/texture_generator.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/texturing/texture_generator.js b/js/texturing/texture_generator.js index a66808b2..49bd2dc7 100644 --- a/js/texturing/texture_generator.js +++ b/js/texturing/texture_generator.js @@ -35,7 +35,7 @@ const TextureGenerator = { compress: {label: 'dialog.create_texture.compress', type: 'checkbox', value: true, condition: (form) => (Project.box_uv && form.rearrange_uv)}, power: {label: 'dialog.create_texture.power', type: 'checkbox', value: true, condition: (form) => (form.rearrange_uv)}, double_use: {label: 'dialog.create_texture.double_use', type: 'checkbox', value: true, condition: (form) => (Project.box_uv && form.rearrange_uv)}, - box_uv: {label: 'dialog.project.box_uv', type: 'checkbox', value: false, condition: !Project.box_uv}, + box_uv: {label: 'dialog.project.uv_mode.box_uv', type: 'checkbox', value: false, condition: !Project.box_uv}, padding: {label: 'dialog.create_texture.padding', type: 'checkbox', value: false, condition: (form) => (form.rearrange_uv)}, color: {label: 'data.color', type: 'color', colorpicker: TextureGenerator.background_color}, resolution: {label: 'dialog.create_texture.resolution', type: 'select', value: 16, options: { @@ -543,10 +543,10 @@ const TextureGenerator = { function faceRect(cube, face_key, tex, x, y) { this.cube = cube; if (options.rearrange_uv) { - this.width = Math.abs(x); - this.height = Math.abs(y); - this.width = (this.width >= 0.01 && this.width < 1) ? 1 : Math.round(this.width ); - this.height = (this.height >= 0.01 && this.height < 1) ? 1 : Math.round(this.height); + this.width = Math.abs(x) * res_multiple; + this.height = Math.abs(y) * res_multiple; + this.width = ((this.width >= 0.01 && this.width < 1) ? 1 : Math.round(this.width)) / res_multiple; + this.height = ((this.height >= 0.01 && this.height < 1) ? 1 : Math.round(this.height)) / res_multiple; } else { this.posx = cube.faces[face_key].uv[0], cube.faces[face_key].uv[0+2]; this.posy = cube.faces[face_key].uv[1], cube.faces[face_key].uv[1+2];