diff --git a/js/animations/timeline.js b/js/animations/timeline.js index c5d7e23b..37da98e8 100644 --- a/js/animations/timeline.js +++ b/js/animations/timeline.js @@ -96,16 +96,21 @@ const Timeline = { e.clientX - R.panel_offset[0], e.clientY - R.panel_offset[1], ] + R.start_event = e; if (e.shiftKey || Pressing.overrides.shift) { Timeline.selector.selected_before = Timeline.selected.slice(); } - R.selecting = true; - $('#timeline_selector').show() - Timeline.selector.move(e) }, move(e) { var R = Timeline.selector; - if (!R.selecting) return; + if (!R.selecting) { + if (Math.pow(R.start_event.clientX - mouse_pos.x, 2) + Math.pow(R.start_event.clientY - mouse_pos.y, 2) > 20) { + R.selecting = true; + $('#timeline_selector').show(); + } else { + return; + } + } //CSS var offset = $('#timeline_body_inner').offset(); R.panel_offset = [ @@ -186,19 +191,27 @@ const Timeline = { updateKeyframeSelection() }, end(e) { - if (!Timeline.selector.selecting) return false; e.stopPropagation(); document.removeEventListener('mousemove', Timeline.selector.move); clearInterval(Timeline.selector.interval); document.removeEventListener('mouseup', Timeline.selector.end); - updateKeyframeSelection() - Timeline.selector.selected_before.empty(); - Timeline.selector.selecting = false; - $('#timeline_selector') - .css('width', 0) - .css('height', 0) - .hide() + if (!Timeline.selector.selecting) { + if (settings.canvas_unselect.value) { + Timeline.selected.empty(); + updateKeyframeSelection(); + } + Timeline.vue.clickGraphEditor(e); + return false; + } else { + updateKeyframeSelection() + Timeline.selector.selected_before.empty(); + Timeline.selector.selecting = false; + $('#timeline_selector') + .css('width', 0) + .css('height', 0) + .hide(); + } }, }, setTime(seconds, editing) { @@ -1515,7 +1528,7 @@ Interface.definePanels(() => {
-
+
diff --git a/lang/en.json b/lang/en.json index 40514b51..1390a525 100644 --- a/lang/en.json +++ b/lang/en.json @@ -880,7 +880,7 @@ "settings.local_move": "Move on Relative Axes", "settings.local_move.desc": "Move rotated elements on their own axes if possible", "settings.canvas_unselect": "Unselect when Clicking Background", - "settings.canvas_unselect.desc": "Unselects all elements when clicking on the background behind the model", + "settings.canvas_unselect.desc": "Unselects all elements when clicking on the background behind the model or in the timeline", "settings.double_click_switch_tools": "Switch Tools on Double Click", "settings.double_click_switch_tools.desc": "Double click the viewport to switch between tools", "settings.highlight_cubes": "Highlight Elements",