Commit 37f6c11f authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

fix reference to "scope~" classname in g_editor, refactor pdgui.js to fit the...

fix reference to "scope~" classname in g_editor, refactor pdgui.js to fit the new cyclone color methods
parent 8af42734
......@@ -3692,6 +3692,7 @@ function gui_scope_draw_bg(cid, tag, fg_color, bg_color, w, h, grid_width, dx, d
d: path_string,
fill: "none",
stroke: "black",
class: "grid",
"stroke-width": grid_width,
});
// We go ahead and create a path to be used in the foreground. We'll
......@@ -3730,13 +3731,13 @@ function gui_scope_configure_fg_mono(cid, tag, data_array) {
scope_configure_fg(cid, tag, ".fgmono", data_array);
}
function gui_scope_configure_bg_color(cid, tag, color) {
function scope_configure_bg_color(cid, tag, color) {
var g = get_gobj(cid, tag),
elem = g.querySelector(".bg");
configure_item(elem, { fill: color });
}
function gui_scope_configure_fg_color(cid, tag, color) {
function scope_configure_fg_color(cid, tag, color) {
var g = get_gobj(cid, tag),
xy = g.querySelector(".fgxy"),
mono = g.querySelector(".fgmono");
......@@ -3744,6 +3745,22 @@ function gui_scope_configure_fg_color(cid, tag, color) {
configure_item(mono, { stroke: color });
}
function scope_configure_grid_color(cid, tag, color) {
var g = get_gobj(cid, tag),
grid = g.querySelector(".grid");
configure_item(grid, { stroke: color });
}
function gui_scope_configure_color(cid, tag, layer, color) {
if (layer === "fg") {
scope_configure_fg_color(cid, tag, color);
} else if (layer === "bg") {
scope_configure_bg_color(cid, tag, color);
} else if (layer === "grid") {
scope_configure_grid_color(cid, tag, color);
}
}
function gui_scope_clear_fg(cid, tag) {
scope_configure_fg(cid, tag, ".fgxy", []);
scope_configure_fg(cid, tag, ".fgmono", []);
......
......@@ -3307,7 +3307,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
int noutlet;
int ninlet;
/* resize? only for "true" text boxes, canvases, iemguis,
and -- using an awful hack-- for the Scope~ and grid
and -- using an awful hack-- for the scope~ and grid
objects by checking for the class name below.
One exception-- my_canvas. It has a weirdo interface
......@@ -3320,7 +3320,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
*/
if (ob && (ob->te_iemgui
&& pd_class((t_pd *)ob) != my_canvas_class
|| pd_class(&ob->te_pd)->c_name == gensym("Scope~")
|| pd_class(&ob->te_pd)->c_name == gensym("scope~")
|| pd_class(&ob->te_pd)->c_name == gensym("grid"))
&& xpos >= x2-4 && ypos > y2-6)
{
......@@ -3339,7 +3339,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
}
else
{
pd_vmess((t_pd *)ob, gensym("_click_for_resizing"),
pd_vmess((t_pd *)ob, gensym("_click"),
"fff", (t_float)1, (t_float)xpos, (t_float)ypos);
}
}
......@@ -5277,10 +5277,10 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
pd_vmess(sh, gensym("_motion"), "ff", (t_float)xpos, (t_float)ypos);
//pd_vmess(sh, gensym("_click"), "fff", 0, xpos, ypos);
}
else if (ob && (pd_class(&ob->te_pd)->c_name == gensym("Scope~")
else if (ob && (pd_class(&ob->te_pd)->c_name == gensym("scope~")
|| pd_class(&ob->te_pd)->c_name == gensym("grid")))
{
pd_vmess((t_pd *)ob, gensym("_motion_for_resizing"),
pd_vmess((t_pd *)ob, gensym("_motion"),
"ff", (t_float)xpos, (t_float)ypos);
}
else post("not resizable");
......
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