From f330ed2f800ead24fdd871e9f8f70224234db57a Mon Sep 17 00:00:00 2001 From: dzmipt Date: Sun, 17 Nov 2024 12:44:00 +0100 Subject: [PATCH] while selecting and adding line, do not zoom with the mouse drag --- src/studio/ui/chart/ChartPanel.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/studio/ui/chart/ChartPanel.java b/src/studio/ui/chart/ChartPanel.java index 646da8f..96e3946 100644 --- a/src/studio/ui/chart/ChartPanel.java +++ b/src/studio/ui/chart/ChartPanel.java @@ -196,6 +196,12 @@ public void mousePressed(MouseEvent e) { if (chart == null) { return; } + if (selectedLine != null) return; + + if (addingLine) { + addLine(e); + return; + } Plot plot = chart.getPlot(); int mods = e.getModifiers(); if ((mods & this.panMask) == this.panMask) { @@ -337,12 +343,6 @@ else if (e.isPopupTrigger()) { } - @Override - public void mouseClicked(MouseEvent event) { - if (addingLine) addLine(event); - super.mouseClicked(event); - } - private void addLineAction() { addingLine = true; }