Browse Source

bordercolor fix in upernodecanvas; visual bug fix

Kevin Trometer 7 years ago
parent
commit
e9608c3f0c
2 changed files with 8 additions and 3 deletions
  1. 4 1
      src/ui/view/MyCanvas.java
  2. 4 2
      src/ui/view/UpperNodeCanvas.java

+ 4 - 1
src/ui/view/MyCanvas.java

@@ -742,6 +742,9 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 
 	@Override
 	public void mouseReleased(MouseEvent e) {
+		x = e.getX();
+		y = e.getY();
+		
 		dragging = false;
 
 		if (drawEdge) {
@@ -912,7 +915,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 	public void mouseMoved(MouseEvent e) {
 		x = e.getX();
 		y = e.getY();
-		
+
 		// Everytghing for the tooltip :)
 		boolean on = false;
 		for (AbstractCpsObject cps : model.getObjectsOnCanvas()) {

+ 4 - 2
src/ui/view/UpperNodeCanvas.java

@@ -595,8 +595,8 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 			if (showedInformation[3]) {
 				g2.setColor(cps.getBorderColor());
 				if (g2.getColor() != Color.WHITE) {
-					g2.fillRect((int) (cps.getPosition().x - scalediv20 - 3),
-							(int) (cps.getPosition().y - scalediv20 - 3),
+					g2.fillRect((int) (cps.getPosition().x - controller.getScaleDiv2() - scalediv20 - 3),
+							(int) (cps.getPosition().y - model.getScaleDiv2() - scalediv20 - 3),
 							(int) (controller.getScale() + ((scalediv20 + 3) * 2)),
 							(int) (controller.getScale() + ((scalediv20 + 3) * 2)));
 				}
@@ -910,6 +910,8 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 
 	@Override
 	public void mouseReleased(MouseEvent e) {
+		x = e.getX();
+		y = e.getY();
 		dragging = false;
 		if (model.getSelectedCpsObjects().size() > 1) {
 			model.getTableHolonElement().setModel(model.getMultiTable());