Commit f2bb2e02 authored by Jonathan Wilkes's avatar Jonathan Wilkes Committed by Albert Gräf
Browse files

simplify gui_text_draw_border

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