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

simplify gui_text_draw_border

parent 5cfa3c53
......@@ -1964,15 +1964,15 @@ function gui_gobj_new(cid, tag, type, xpos, ypos, is_toplevel) {
return g;
}
function gui_text_draw_border(cid, tag, bgcolor, isbroken, x1, y1, x2, y2) {
function gui_text_draw_border(cid, tag, bgcolor, isbroken, width, height) {
gui(cid).get_gobj(tag)
.append(function(frag) {
// isbroken means either
// a) the object couldn't create or
// b) the box is empty
var rect = create_item(cid, "rect", {
width: x2 - x1,
height: y2 - y1,
width: width,
height: height,
//"shape-rendering": "crispEdges",
class: "border"
});
......
......@@ -1180,12 +1180,13 @@ void iemgui_base_draw_new(t_iemgui *x) {
sprintf(colorbuf, "#%6.6x", x->x_bcol);
gui_vmess("gui_gobj_new", "xxsiii", canvas, x,
"iemgui", x1, y1, glist_istoplevel(x->x_glist));
gui_vmess("gui_text_draw_border", "xxsiiiii",
gui_vmess("gui_text_draw_border", "xxsiii",
canvas,
x,
colorbuf,
0,
x1, y1, x2, y2);
x2 - x1,
y2 - y1);
sprintf(colorbuf, "#%6.6x", x->x_bcol);
gui_vmess("gui_iemgui_base_color", "xxs",
canvas, x, colorbuf);
......
......@@ -934,11 +934,13 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
{
if (vis && gobj_shouldvis(gr, parent_glist))
{
gui_vmess("gui_text_draw_border", "xssiiiii",
gui_vmess("gui_text_draw_border", "xssiii",
glist_getcanvas(x->gl_owner),
tag,
"none",
0, x1, y1, x2, y2);
0,
x2 - x1,
y2 - y1);
glist_noselect(x->gl_owner);
gui_vmess("gui_graph_fill_border", "xsi",
glist_getcanvas(x->gl_owner),
......@@ -966,12 +968,13 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
(x->gl_xlabely > 0.5*(x->gl_y1 + x->gl_y2) ? "s" : "n");
char tagbuf[MAXPDSTRING];
sprintf(tagbuf, "%sR", tag);
gui_vmess("gui_text_draw_border", "xssiiiii",
gui_vmess("gui_text_draw_border", "xssiii",
glist_getcanvas(x->gl_owner),
tag,
"none",
0, x1, y1, x2, y2);
0,
x2 - x1,
y2 - y1);
/* write garrays' names along the top */
for (i = 0, g = x->gl_list; g; g = g->g_next, i++)
{
......
......@@ -2659,15 +2659,13 @@ void text_drawborder(t_text *x, t_glist *glist,
}
if (firsttime)
{
gui_vmess("gui_text_draw_border", "xssiiiii",
gui_vmess("gui_text_draw_border", "xssiii",
glist_getcanvas(glist),
tag,
"none",
broken,
x1,
y1,
x2,
y2);
x2 - x1,
y2 - y1);
//-dash %s -> pattern disabled for tkpath
}
else
......
Markdown is supported
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