Commit 7cab9c72 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

restore the ability to show multiple iemgui label handles at once, and use...

restore the ability to show multiple iemgui label handles at once, and use class instead of id to identify them
parent 11b50a95
......@@ -124,7 +124,7 @@ var canvas_events = (function() {
var target_id;
if (target_is_scrollbar(evt)) {
return;
} else if (evt.target.id === "clickable_resize_handle") {
} else if (evt.target.classList.contains("clickable_resize_handle")) {
// get id ("x123456etcgobj" without the "x" or "gobj")
target_id = "_h" +
evt.target.parentNode.id.slice(0,-4).slice(1);
......@@ -404,7 +404,7 @@ var canvas_events = (function() {
var dx = (evt.pageX + svg_view.x) - last_draggable_x,
dy = (evt.pageY + svg_view.y) - last_draggable_y,
handle_elem =
document.getElementById("clickable_resize_handle"),
document.querySelector(".clickable_resize_handle"),
target_id = "_h" +
handle_elem.parentNode.id.slice(0,-4).slice(1),
is_canvas_gop_rect = document.
......
......@@ -2368,9 +2368,9 @@ function gui_iemgui_label_show_drag_handle(cid, tag, state, x, y) {
y: y + 3,
width: 7,
height: 7,
id: "clickable_resize_handle",
class: (cid === tag) ? "gop_drag_handle" : "label_drag_handle"
});
rect.classList.add("clickable_resize_handle");
gobj.appendChild(rect);
} else {
if (gobj) {
......
......@@ -711,18 +711,9 @@ void scalehandle_draw_select(t_scalehandle *h, int px, int py) {
if (!h->h_vis) {
sprintf(tagbuf, "x%lx", (long unsigned int)x);
/* A hack to keep from drawing a bunch of iemgui label handles
in a large selection. Here we just draw one on the first
iemgui in the selection, or-- it's a canvas-- we draw it
on the gop rectangle */
if (pd_class((t_pd *)x) == canvas_class ||
(canvas->gl_editor && canvas->gl_editor->e_selection &&
!canvas->gl_editor->e_selection->sel_next))
{
gui_vmess("gui_iemgui_label_show_drag_handle", "xsiii",
canvas, tagbuf, 1, px - sx, py - sy);
h->h_vis = 1;
}
gui_vmess("gui_iemgui_label_show_drag_handle", "xsiii",
canvas, tagbuf, 1, px - sx, py - sy);
h->h_vis = 1;
}
}
......
Supports Markdown
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