Commit ede2ff7b authored by Jonathan Wilkes's avatar Jonathan Wilkes

guard mknob against early messages from Pd

parent c5f5a579
......@@ -4039,23 +4039,31 @@ function gui_grid_point(cid, tag, x, y) {
// mknob from moonlib
function gui_mknob_new(cid, tag, x, y, is_toplevel, show_in, show_out) {
var g = gui_gobj_new(cid, tag, "obj", x, y, is_toplevel),
var g, border, circle, line;
if (!patchwin[cid]) {
return;
}
g = gui_gobj_new(cid, tag, "obj", x, y, is_toplevel),
border = create_item(cid, "path", {
class: "border" // now we can inherit the css border styles
}),
circle = create_item(cid, "circle", {
class: "circle"
}),
line = create_item(cid, "line", {
class: "dial"
});
});
circle = create_item(cid, "circle", {
class: "circle"
});
line = create_item(cid, "line", {
class: "dial"
});
g.appendChild(border);
g.appendChild(circle);
g.appendChild(line);
}
function gui_configure_mknob(cid, tag, size, bg_color, fg_color) {
var g = get_gobj(cid, tag);
var g;
if (!patchwin[cid]) {
return;
}
g = get_gobj(cid, tag);
configure_item(g.querySelector(".border"), {
d: ["M", 0, 0, size, 0,
"M", 0, size, size, size,
......
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