X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=net.mograsim.logic.model.editor%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Feditor%2FEditor.java;h=e3279150e4710f780cebd3302fa066f1698c07f3;hb=6483203309e7bb43014582e40b205e9bddda3b72;hp=945490cb8fed1e320ec740c660286c75f3a8555e;hpb=878d036669f4aa9d0c332ced43da3a08b94655e9;p=Mograsim.git diff --git a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/Editor.java b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/Editor.java index 945490cb..e3279150 100644 --- a/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/Editor.java +++ b/net.mograsim.logic.model.editor/src/net/mograsim/logic/model/editor/Editor.java @@ -192,8 +192,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;