Commit bd308c14 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

clean up g_slider.c

parent fb17c23f
......@@ -2016,7 +2016,7 @@ function gui_update_numbox_text_position(cid, tag, x, y) {
});
}
function gui_create_slider(cid,tag,color,p1,p2,p3,p4,basex, basey) {
function gui_create_slider(cid,tag,x_color,p1,p2,p3,p4,basex, basey) {
var g = get_gobj(cid, tag),
indicator;
indicator = create_item(cid, "line", {
......@@ -2024,7 +2024,7 @@ function gui_create_slider(cid,tag,color,p1,p2,p3,p4,basex, basey) {
y1: p2 - basey,
x2: p3 - basex,
y2: p4 - basey,
stroke: color,
stroke: x2h(x_color),
"stroke-width": 3,
fill: "none",
id: tag + "indicator"
......@@ -2043,10 +2043,10 @@ function gui_slider_update(cid,tag,p1,p2,p3,p4,basex,basey) {
});
}
function gui_slider_indicator_color(cid, tag, color) {
function gui_slider_indicator_color(cid, tag, x_color) {
var i = get_item(cid, tag + "indicator");
configure_item(i, {
stroke: color
stroke: x2h(x_color)
});
}
......
......@@ -63,17 +63,13 @@ static void slider_draw_new(t_slider *x, t_glist *glist)
else r = x1+3 + (x->x_val + 50)/100;
iemgui_base_draw_new(&x->x_gui);
if (x->x_orient) {
char colorbuf[MAXPDSTRING];
sprintf(colorbuf, "#%6.6x", x->x_gui.x_fcol);
gui_vmess("gui_create_slider", "xxsiiiiii",
gui_vmess("gui_create_slider", "xxxiiiiii",
canvas, x,
colorbuf, x1+2, r, x2-2, r, x1, y1);
x->x_gui.x_fcol, x1+2, r, x2-2, r, x1, y1);
} else {
char colorbuf[MAXPDSTRING];
sprintf(colorbuf, "#%6.6x", x->x_gui.x_fcol);
gui_vmess("gui_create_slider", "xxsiiiiii",
gui_vmess("gui_create_slider", "xxxiiiiii",
canvas, x,
colorbuf, r, y1+2, r, y2-2, x1, y1);
x->x_gui.x_fcol, r, y1+2, r, y2-2, x1, y1);
}
}
......@@ -106,10 +102,8 @@ static void slider_draw_config(t_slider *x, t_glist *glist)
{
t_canvas *canvas=glist_getcanvas(glist);
iemgui_base_draw_config(&x->x_gui);
char colorbuf[MAXPDSTRING];
sprintf(colorbuf, "#%6.6x", x->x_gui.x_fcol);
gui_vmess("gui_slider_indicator_color", "xxs",
canvas, x, colorbuf);
gui_vmess("gui_slider_indicator_color", "xxx",
canvas, x, x->x_gui.x_fcol);
}
void slider_check_minmax(t_slider *x, double min, double max);
......
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