Merge pull request #1534 from SiboVG/issue-1533

[#1533] Fix latency of freeform finset shape editor
This commit is contained in:
SiboVG 2022-07-18 16:36:11 +02:00 committed by GitHub
commit 3ffb2ea669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,6 +81,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
private Point dragPoint = null; private Point dragPoint = null;
private FinPointFigure figure = null; private FinPointFigure figure = null;
private ScaleScrollPane figurePane = null;
private ScaleSelector selector; private ScaleSelector selector;
public FreeformFinSetConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) { public FreeformFinSetConfig(OpenRocketDocument d, RocketComponent component, JDialog parent) {
@ -219,7 +220,7 @@ public class FreeformFinSetConfig extends FinSetConfig {
// Create the figure // Create the figure
figure = new FinPointFigure(finset); figure = new FinPointFigure(finset);
ScaleScrollPane figurePane = new FinPointScrollPane( figure); figurePane = new FinPointScrollPane( figure);
// Create the table // Create the table
tableModel = new FinPointTableModel(); tableModel = new FinPointTableModel();
@ -392,9 +393,10 @@ public class FreeformFinSetConfig extends FinSetConfig {
} }
figure.updateFigure(); figure.updateFigure();
} }
revalidate(); if (figurePane != null) {
repaint(); figurePane.revalidate();
}
} }
private class FinPointScrollPane extends ScaleScrollPane { private class FinPointScrollPane extends ScaleScrollPane {
@ -408,8 +410,6 @@ public class FreeformFinSetConfig extends FinSetConfig {
@Override @Override
public void mousePressed(MouseEvent event) { public void mousePressed(MouseEvent event) {
int mods = event.getModifiersEx();
final FreeformFinSet finset = (FreeformFinSet) component; final FreeformFinSet finset = (FreeformFinSet) component;
final int pressIndex = getPoint(event); final int pressIndex = getPoint(event);