diff --git a/src/plugins/plot/MctPlot.vue b/src/plugins/plot/MctPlot.vue index 76815cc53d5..692280da56b 100644 --- a/src/plugins/plot/MctPlot.vue +++ b/src/plugins/plot/MctPlot.vue @@ -854,13 +854,11 @@ export default { this.canvas = this.$refs.chartContainer.querySelectorAll('canvas')[1]; - if (!this.options.compact) { - this.listenTo(this.canvas, 'mousemove', this.trackMousePosition, this); - this.listenTo(this.canvas, 'mouseleave', this.untrackMousePosition, this); - this.listenTo(this.canvas, 'mousedown', this.onMouseDown, this); - this.listenTo(this.canvas, 'click', this.selectNearbyAnnotations, this); - this.listenTo(this.canvas, 'wheel', this.wheelZoom, this); - } + this.listenTo(this.canvas, 'mousemove', this.trackMousePosition, this); + this.listenTo(this.canvas, 'mouseleave', this.untrackMousePosition, this); + this.listenTo(this.canvas, 'mousedown', this.onMouseDown, this); + this.listenTo(this.canvas, 'click', this.selectNearbyAnnotations, this); + this.listenTo(this.canvas, 'wheel', this.wheelZoom, this); }, marqueeAnnotations(annotationsToSelect) { @@ -1115,19 +1113,21 @@ export default { this.listenTo(window, 'mouseup', this.onMouseUp, this); this.listenTo(window, 'mousemove', this.trackMousePosition, this); - // track frozen state on mouseDown to be read on mouseUp - const isFrozen = - this.config.xAxis.get('frozen') === true && this.config.yAxis.get('frozen') === true; - this.isFrozenOnMouseDown = isFrozen; + if (!this.options.compact) { + // track frozen state on mouseDown to be read on mouseUp + const isFrozen = + this.config.xAxis.get('frozen') === true && this.config.yAxis.get('frozen') === true; + this.isFrozenOnMouseDown = isFrozen; - if (event.altKey && !event.shiftKey) { - return this.startPan(event); - } else if (event.altKey && event.shiftKey) { - this.freeze(); + if (event.altKey && !event.shiftKey) { + return this.startPan(event); + } else if (event.altKey && event.shiftKey) { + this.freeze(); - return this.startMarquee(event, true); - } else { - return this.startMarquee(event, false); + return this.startMarquee(event, true); + } else { + return this.startMarquee(event, false); + } } }, @@ -1158,11 +1158,15 @@ export default { }, isMouseClick() { - if (!this.marquee) { + // We may not have a marquee if we've disabled pan/zoom, but we still need to know if it's a mouse click for highlights and lock points. + if (!this.marquee && !this.positionOverPlot) { return false; } - const { start, end } = this.marquee; + const { start, end } = this.marquee ?? { + start: this.positionOverPlot, + end: this.positionOverPlot + }; const someYPositionOverPlot = start.y.some((y) => y); return start.x === end.x && someYPositionOverPlot; diff --git a/src/plugins/plot/PlotView.vue b/src/plugins/plot/PlotView.vue index 34eac983314..48395b4dbf4 100644 --- a/src/plugins/plot/PlotView.vue +++ b/src/plugins/plot/PlotView.vue @@ -162,14 +162,6 @@ export default { } } }, - watch: { - gridLines(newGridLines) { - this.gridLines = newGridLines; - }, - cursorGuide(newCursorGuide) { - this.cursorGuide = newCursorGuide; - } - }, created() { eventHelpers.extend(this); this.imageExporter = new ImageExporter(this.openmct);