Skip to content

Commit

Permalink
Fix settings and keybindings search bar character casing issue
Browse files Browse the repository at this point in the history
Fix keybinding conflicts not showing on start
Fix some settings not updating correctly
Fix copy paste tool accuracy issue
  • Loading branch information
JannisX11 committed Jun 10, 2022
1 parent 45d5ef2 commit 502c2b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion js/interface/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -548,6 +548,9 @@ onVueSetup(function() {
},
onButton() {
Settings.save();
},
onOpen() {
updateKeybindConflicts();
}
})
})
Expand Down
4 changes: 2 additions & 2 deletions js/interface/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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];
Expand Down
7 changes: 4 additions & 3 deletions js/texturing/uv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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';
Expand All @@ -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);
Expand Down

0 comments on commit 502c2b3

Please sign in to comment.