diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index aa8d07b7afba23a322768e85baa6f00eab7f3675..f408553d59909e13f7aa19429e744d39ad1b5a07 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -1473,13 +1473,21 @@ function gui_message_redraw_border(cid, tag, width, height) { }); } +function atom_border_points(width, height) { + return [0, 0, + width - 4, 0, + width, 4, + width, height, + 0, height, + 0, 0] + .join(" "); +} -function gui_atom_draw_border(cid,tag,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) { - var p_array = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12], - g = get_gobj(cid, tag), +function gui_atom_draw_border(cid, tag, width, height) { + var g = get_gobj(cid, tag), polygon; polygon = create_item(cid, "polygon", { - points: p_array.join(" "), + points: atom_border_points(width, height), fill: "none", stroke: "gray", "stroke-width": 1, diff --git a/pd/src/g_text.c b/pd/src/g_text.c index 45af306091c23987db94f88c1fe6050ea04ea537..a39ee9b84e24838af17f26301bcc7efe1cc966d9 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -2211,9 +2211,7 @@ void text_drawborder(t_text *x, t_glist *glist, // tag, tag, (selected ? "selected" : "")); /* These coords can be greatly simplified... */ gui_vmess("gui_atom_draw_border", "xsiiiiiiiiiiii", - glist_getcanvas(glist), tag, - x1-x1, y1-y1, x2-4-x1, y1-y1, x2-x1, - y1+4-y1, x2-x1, y2-y1, x1-x1, y2-y1, x1-x1, y1-y1); + glist_getcanvas(glist), tag, x2 - x1, y2 - y1); } else {