Skip to content
Snippets Groups Projects
Commit a965e745 authored by Fabien Tessier's avatar Fabien Tessier
Browse files

Issue #99: Delete on selected components sometimes fails

parent 50db19da
No related branches found
No related tags found
1 merge request!20Issue #99: Delete on selected components sometimes fails
...@@ -133,6 +133,7 @@ public class TDiagramMouseManager extends MouseAdapter {//implements MouseListen ...@@ -133,6 +133,7 @@ public class TDiagramMouseManager extends MouseAdapter {//implements MouseListen
tdp.mode = TDiagramPanel.SELECTING_COMPONENTS; tdp.mode = TDiagramPanel.SELECTING_COMPONENTS;
tdp.setSelectingComponents(e.getX(), e.getY()); tdp.setSelectingComponents(e.getX(), e.getY());
} else { } else {
tdp.mgui.actions[TGUIAction.ACT_DELETE].setEnabled(true);
// Resize, move, or make a connector // Resize, move, or make a connector
if (tgc.isUserResizable() && ((resizeInfo=tgc.getResizeZone(e.getX(), e.getY())) != 0)) { if (tgc.isUserResizable() && ((resizeInfo=tgc.getResizeZone(e.getX(), e.getY())) != 0)) {
actionMade = true; actionMade = true;
...@@ -466,6 +467,10 @@ public class TDiagramMouseManager extends MouseAdapter {//implements MouseListen ...@@ -466,6 +467,10 @@ public class TDiagramMouseManager extends MouseAdapter {//implements MouseListen
//If one click is done for selection //If one click is done for selection
if ((selected == TGComponentManager.EDIT) && (e.getClickCount() == 1) && (e.getButton() == MouseEvent.BUTTON1)) { if ((selected == TGComponentManager.EDIT) && (e.getClickCount() == 1) && (e.getButton() == MouseEvent.BUTTON1)) {
setSelection(e.getX(), e.getY()); setSelection(e.getX(), e.getY());
if (tdp.select)
tdp.mgui.actions[TGUIAction.ACT_DELETE].setEnabled(true);
else
tdp.mgui.actions[TGUIAction.ACT_DELETE].setEnabled(false);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment