Moved Am2904/Am2910Testbenches to test source folder
[Mograsim.git] / net.mograsim.logic.model.editor / src / net / mograsim / logic / model / editor / Editor.java
index 945490c..e2dee42 100644 (file)
@@ -175,7 +175,9 @@ public final class Editor
 
        public static String getIdentifier(GUIComponent c)
        {
-               return identifierPerComponent.get(c);
+               if (identifierPerComponent.containsKey(c))
+                       return identifierPerComponent.get(c);
+               return "class:" + c.getClass().getCanonicalName();
        }
 
        public void duplicate()
@@ -192,8 +194,8 @@ public final class Editor
                case OFF:
                        break;
                case ABSOLUTE:
-                       newP.x -= newP.x % snapX;
-                       newP.y -= newP.y % snapY;
+                       newP.x = (int) (newP.x / snapX + .5) * snapX;
+                       newP.y = (int) (newP.y / snapY + .5) * snapY;
                        break;
                default:
                        break;