Fix canvas click unselect triggered by rotate key

Fix issue with whitespaces in anim time update variable
This commit is contained in:
JannisX11 2020-09-29 15:55:08 +02:00
parent de397a66e6
commit 806bbd61a0
3 changed files with 6 additions and 28 deletions

View File

@ -318,28 +318,6 @@ class Animation {
})
return this;
}
editUpdateVariable() {
var scope = this;
Blockbench.textPrompt('menu.animation.anim_time_update', scope.anim_time_update, function(value) {
if (value !== scope.anim_time_update) {
Undo.initEdit({animations: [scope]})
scope.anim_time_update = value
Undo.finishEdit('change animation variable')
}
})
return this;
}
editBlendWeight() {
var scope = this;
Blockbench.textPrompt('menu.animation.blend_weight', scope.blend_weight, function(value) {
if (value !== scope.blend_weight) {
Undo.initEdit({animations: [scope]})
scope.blend_weight = value
Undo.finishEdit('change animation blend weight')
}
})
return this;
}
togglePlayingState(state) {
if (!this.selected) {
this.playing = state !== undefined ? state : !this.playing;
@ -521,12 +499,13 @@ class Animation {
Undo.initEdit({animations: [this]});
this.loop = form_data.loop;
this.name = form_data.name;
this.createUniqueName();
if (isApp) this.path = form_data.path;
this.loop = form_data.loop;
this.override = form_data.override;
this.snapping = Math.clamp(form_data.snapping, 10, 100);
this.anim_time_update = vue_data.anim_time_update;
this.blend_weight = vue_data.blend_weight;
this.anim_time_update = vue_data.anim_time_update.trim().replace(/\n/g, '');
this.blend_weight = vue_data.blend_weight.trim().replace(/\n/g, '');
Undo.finishEdit('edit animation properties');
}
}

View File

@ -663,10 +663,6 @@ THREE.OrbitControls = function ( object, preview ) {
scope.dispatchEvent( endEvent );
state = STATE.NONE;
if (scope.hasMoved === false && settings.canvas_unselect.value) {
unselectAll()
}
}
this.stopMovement = function(event) {
onMouseUp()

View File

@ -612,6 +612,9 @@ class Preview {
if (typeof Toolbox.selected.onCanvasClick === 'function') {
Toolbox.selected.onCanvasClick(0)
}
if (!data && this.controls.hasMoved === false && settings.canvas_unselect.value) {
unselectAll()
}
if (this.angle !== null && this.camOrtho.axis || this.movingBackground) {
this.startSelRect(event)