From 502c2b33215e8e97bb9b8d6dd8459a90da406b6b Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Fri, 10 Jun 2022 17:55:13 +0200 Subject: [PATCH] Fix settings and keybindings search bar character casing issue Fix keybinding conflicts not showing on start Fix some settings not updating correctly Fix copy paste tool accuracy issue --- js/interface/keyboard.js | 5 ++++- js/interface/settings.js | 4 ++-- js/texturing/uv.js | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/js/interface/keyboard.js b/js/interface/keyboard.js index 913b1b8..0f5ad51 100644 --- a/js/interface/keyboard.js +++ b/js/interface/keyboard.js @@ -492,7 +492,7 @@ onVueSetup(function() { computed: { list() { if (this.search_term) { - var keywords = this.search_term.replace(/_/g, ' ').split(' '); + var keywords = this.search_term.toLowerCase().replace(/_/g, ' ').split(' '); var actions = []; for (var action of Keybinds.actions) { @@ -548,6 +548,9 @@ onVueSetup(function() { }, onButton() { Settings.save(); + }, + onOpen() { + updateKeybindConflicts(); } }) }) diff --git a/js/interface/settings.js b/js/interface/settings.js index c0437d9..f01c9a7 100644 --- a/js/interface/settings.js +++ b/js/interface/settings.js @@ -385,7 +385,7 @@ const Settings = { } for (var id in settings) { var setting = settings[id]; - if (!Condition(setting.condition)) return; + if (!Condition(setting.condition)) continue; if (setting.onChange && hasSettingChanged(id)) { setting.onChange(setting.value); } @@ -559,7 +559,7 @@ onVueSetup(function() { computed: { list() { if (this.search_term) { - var keywords = this.search_term.replace(/_/g, ' ').split(' '); + var keywords = this.search_term.toLowerCase().replace(/_/g, ' ').split(' '); var items = {}; for (var key in settings) { var setting = settings[key]; diff --git a/js/texturing/uv.js b/js/texturing/uv.js index c6cacdc..f481657 100644 --- a/js/texturing/uv.js +++ b/js/texturing/uv.js @@ -159,9 +159,6 @@ const UVEditor = { let texture = UVEditor.texture; var {x, y} = UVEditor.getBrushCoordinates(e1, texture); if (texture.img.naturalWidth + texture.img.naturalHeight == 0) return; - if (x === Painter.current.x && y === Painter.current.y) return; - Painter.current.x = x = Math.clamp(x, 0, texture.img.naturalWidth); - Painter.current.y = y = Math.clamp(y, 0, texture.img.naturalHeight); UVEditor.dragSelection(x, y, e1); } function stop() { @@ -176,6 +173,9 @@ const UVEditor = { let m = UVEditor.inner_width / UVEditor.texture.width; if (!Painter.selection.overlay) { + if (x === Painter.current.x && y === Painter.current.y) return; + Painter.current.x = x = Math.clamp(x, 0, UVEditor.texture.img.naturalWidth); + Painter.current.y = y = Math.clamp(y, 0, UVEditor.texture.img.naturalHeight); let calcrect = getRectangle(Painter.selection.start_x, Painter.selection.start_y, x, y) if (!calcrect.x && !calcrect.y) return; UVEditor.vue.copy_overlay.state = 'select'; @@ -190,6 +190,7 @@ const UVEditor = { .css('width', calcrect.x *m + 'px') .css('height', calcrect.y *m + 'px') .css('visibility', 'visible') + } else if (UVEditor.texture && Painter.selection.canvas) { Painter.selection.x = Painter.selection.start_x + Math.round((event.clientX - Painter.selection.start_event.clientX) / m); Painter.selection.y = Painter.selection.start_y + Math.round((event.clientY - Painter.selection.start_event.clientY) / m);