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

fix #276: gatom and dropdown should be resizable by click-draggin

parent 05b995f9
...@@ -3352,6 +3352,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, ...@@ -3352,6 +3352,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
} }
else if (!sys_k12_mode && ob && !x->gl_editor->e_textedfor && else if (!sys_k12_mode && ob && !x->gl_editor->e_textedfor &&
(ob->te_pd->c_wb == &text_widgetbehavior || (ob->te_pd->c_wb == &text_widgetbehavior ||
ob->te_type == T_ATOM ||
ob->ob_pd == canvas_class) && ob->ob_pd == canvas_class) &&
xpos >= x2-4 && ypos < y2-4 && ypos > y1+4) xpos >= x2-4 && ypos < y2-4 && ypos > y1+4)
{ {
...@@ -5217,9 +5218,10 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos, ...@@ -5217,9 +5218,10 @@ void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
{ {
int wantwidth = xpos - x11; int wantwidth = xpos - x11;
t_object *ob = pd_checkobject(&y1->g_pd); t_object *ob = pd_checkobject(&y1->g_pd);
if (ob && ob->te_pd->c_wb == &text_widgetbehavior || if (ob && (ob->te_pd->c_wb == &text_widgetbehavior ||
(ob->ob_pd == canvas_class && ob->te_type == T_ATOM ||
!((t_canvas *)ob)->gl_isgraph)) (ob->ob_pd == canvas_class &&
!((t_canvas *)ob)->gl_isgraph)))
{ {
wantwidth = wantwidth / sys_fontwidth(glist_getfont(x)); wantwidth = wantwidth / sys_fontwidth(glist_getfont(x));
if (wantwidth < 1) if (wantwidth < 1)
......
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