Commit 628e57c1 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

simplify gui_atom_draw_border parameters

parent bb472b7c
......@@ -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,
......
......@@ -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
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment