# HG changeset patch # User Nicholas Jillings # Date 1509468293 0 # Node ID a504a17dcf9f362d7bdc905ff09db40577a8d9e2 # Parent 6b95437ae6722b106700a3459bbabcaf4c273e37 Fix some lingering APE.js issues with movement trackers diff -r 6b95437ae672 -r a504a17dcf9f interfaces/ape.js --- a/interfaces/ape.js Tue Oct 31 16:21:58 2017 +0000 +++ b/interfaces/ape.js Tue Oct 31 16:44:53 2017 +0000 @@ -360,6 +360,8 @@ axisInterface.mousedown(this); } else if (e.type == "mouseup") { axisInterface.mouseup(this); + metric.moved(audioEngineContext.timer.getTestTime(), this.value); + console.log("Slider " + label + " on axis " + axisInterface.name + " moved to " + this.value); } } this.clicked = function (e) { @@ -574,14 +576,12 @@ move = Math.max(50, move); move = Math.min(w, move); UI.selected.value = (move / w); - UI.selected.metric.moved(time, UI.selected.value); } else if (event.type == "touchmove") { var move = event.originalEvent.targetTouches[0].clientX - 6; var w = $(event.currentTarget).width(); move = Math.max(50, move); move = Math.min(w, move); UI.selected.value = (move / w); - UI.selected.metric.moved(time, UI.selected.value); } } this.checkAllMoved = function () { diff -r 6b95437ae672 -r a504a17dcf9f js/core.js --- a/js/core.js Tue Oct 31 16:21:58 2017 +0000 +++ b/js/core.js Tue Oct 31 16:44:53 2017 +0000 @@ -2220,10 +2220,19 @@ }; this.moved = function (time, position) { + var last; if (time > 0) { this.wasMoved = true; } - this.movementTracker[this.movementTracker.length] = [time, position]; + // Get the last entry + if (this.movementTracker.length > 0) { + last = this.movementTracker[this.movementTracker.length - 1]; + } else { + last = -1; + } + if (position != last[1]) { + this.movementTracker[this.movementTracker.length] = [time, position]; + } }; this.startListening = function (time) {