diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index b06eba4bdb91ea521f821d29dc6833c177c2a478..72963b5a03c80cf228aa664ae0fb1795e94177a6 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -2359,8 +2359,8 @@ function gui_scalar_draw_select_rect(cid, tag, state, x1, y1, x2, y2, basex, bas
     var g = get_gobj(cid, tag),
         b = g.querySelector(".border");
     configure_item(b, {
-        x: (x1 - basex),
-        y: (y1 - basey),
+        x: (x1 - basex) + 0.5,
+        y: (y1 - basey) + 0.5,
         width: x2 - x1,
         height: y2 - y1,
     });
diff --git a/pd/src/g_scalar.c b/pd/src/g_scalar.c
index c53b45b047b15ab43a78c000325834485d0867c5..81c1f4a349d90e183d99cc671bd64f58c025c82b 100644
--- a/pd/src/g_scalar.c
+++ b/pd/src/g_scalar.c
@@ -554,10 +554,10 @@ void scalar_drawselectrect(t_scalar *x, t_glist *glist, int state)
             gui_vmess("gui_scalar_draw_select_rect", "xsiiiiiff",
                 glist_getcanvas(glist), tagbuf,
                 state,
-                (int)(x1 / xscale + 0.499),
-                (int)(y1 / yscale + 0.499),
-                (int)(x2 / xscale + 0.499),
-                (int)(y2 / yscale + 0.499),
+                (int)(x1 / xscale),
+                (int)(y1 / yscale),
+                (int)(x2 / xscale),
+                (int)(y2 / yscale),
                 basex,
                 basey);
         }