diff --git a/css/dialogs.css b/css/dialogs.css index d753616..c17ebf6 100644 --- a/css/dialogs.css +++ b/css/dialogs.css @@ -350,7 +350,7 @@ } .dialog_sidebar .dialog_sidebar_actions li i { margin-top: 1px; - margin-right: 4px; + margin-right: 8px; margin-left: -28px; flex-shrink: 0; pointer-events: none; @@ -1393,7 +1393,7 @@ max-height: 30px; overflow: hidden; } - div.texture_adjust_previews img { + div.texture_adjust_previews img, div.texture_adjust_previews canvas { max-height: 400px; width: 400px; margin: auto; diff --git a/js/texturing/edit_texture.js b/js/texturing/edit_texture.js index 10d87f7..3bf8425 100644 --- a/js/texturing/edit_texture.js +++ b/js/texturing/edit_texture.js @@ -58,6 +58,11 @@ BARS.defineActions(function() { let ctx = canvas.getContext('2d'); ctx.filter = `brightness(${this.brightness / 100}) contrast(${this.contrast / 100})`; ctx.drawImage(original_imgs[i], 0, 0); + + let ref_ctx = this.$refs.canvas[i].getContext('2d'); + ref_ctx.clearRect(0, 0, texture.width, texture.height); + ref_ctx.drawImage(canvas, 0, 0); + }, {no_undo: true, use_cache: true}); }) }, @@ -67,8 +72,8 @@ BARS.defineActions(function() { }, template: `
-
- +
+
{{ show_preview ? 'expand_more' : 'expand_less' }}
@@ -80,7 +85,14 @@ BARS.defineActions(function() {
- ` + `, + mounted() { + textures.forEach((texture, i) => { + let ref_ctx = this.$refs.canvas[i].getContext('2d'); + ref_ctx.clearRect(0, 0, texture.width, texture.height); + ref_ctx.drawImage(texture.img, 0, 0); + }) + } }, onConfirm() { Undo.finishEdit('Adjust brightness and contrast'); @@ -120,6 +132,11 @@ BARS.defineActions(function() { let ctx = canvas.getContext('2d'); ctx.filter = `saturate(${this.saturation / 100}) hue-rotate(${this.hue}deg)`; ctx.drawImage(original_imgs[i], 0, 0); + + let ref_ctx = this.$refs.canvas[i].getContext('2d'); + ref_ctx.clearRect(0, 0, texture.width, texture.height); + ref_ctx.drawImage(canvas, 0, 0); + }, {no_undo: true, use_cache: true}); }) }, @@ -130,7 +147,7 @@ BARS.defineActions(function() { template: `
- +
{{ show_preview ? 'expand_more' : 'expand_less' }}
@@ -142,7 +159,14 @@ BARS.defineActions(function() {
- ` + `, + mounted() { + textures.forEach((texture, i) => { + let ref_ctx = this.$refs.canvas[i].getContext('2d'); + ref_ctx.clearRect(0, 0, texture.width, texture.height); + ref_ctx.drawImage(texture.img, 0, 0); + }) + } }, onConfirm() { Undo.finishEdit('Adjust saturation and hue');