Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
35a664c6
Commit
35a664c6
authored
May 02, 2016
by
Jonathan Wilkes
Browse files
fix svg_free_events to only free "drag" events (the others are automatically gc'd)
parent
5e6b356b
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/doc/4.data.structures/pd-l2ork/ds-demos/curve-bbox.pd
deleted
100644 → 0
View file @
5e6b356b
#N struct curvebbox float x float y;
#N canvas 0 19 619 300 10;
#X obj 151 34 struct curvebbox float x float y;
#X scalar curvebbox 71 53 \;;
#X text 197 181 Short demo showing that Pd should find the correct
bounding box for a transformed scalar in edit-mode.;
#X text 197 221 Unfortunately it doesn't quite get it right for curves.
You can see with rotation at some angles it doesn't include part of
the curve.;
#N canvas 433 184 450 300 (subpatch) 0;
#X floatatom 163 116 5 0 0 0 - - -, f 5;
#X obj 163 160 draw path M 20 120 C 20 30 40 50 60 70;
#X msg 163 137 transform rotate \$1;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 417 94 group;
#X floatatom 408 21 5 0 0 0 - - -, f 5;
#X msg 408 42 transform translate \$1 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
pd/src/g_template.c
View file @
35a664c6
...
...
@@ -4262,48 +4262,15 @@ t_parentwidgetbehavior draw_widgetbehavior =
static void svg_free_events(t_svg *x)
{
/* This is pretty simplistic-- if the flag is set then we set the
event to zero and send the update to the GUI. */
if (x->x_events.e_focusin.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_focusin.a_attr, 0);
svg_update(x, gensym("focusin"));
}
if (x->x_events.e_activate.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_activate.a_attr, 0);
svg_update(x, gensym("focusout"));
}
if (x->x_events.e_click.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_click.a_attr, 0);
svg_update(x, gensym("click"));
}
if (x->x_events.e_mousedown.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_mousedown.a_attr, 0);
svg_update(x, gensym("mousedown"));
}
if (x->x_events.e_mouseup.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_mouseup.a_attr, 0);
svg_update(x, gensym("mouseup"));
}
if (x->x_events.e_mouseover.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_mouseover.a_attr, 0);
svg_update(x, gensym("mouseover"));
}
if (x->x_events.e_mousemove.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_mousemove.a_attr, 0);
svg_update(x, gensym("mousemove"));
}
if (x->x_events.e_mouseout.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_mouseout.a_attr, 0);
svg_update(x, gensym("mouseout"));
}
/* Right now all the events except for "drag" get automatically
garbage collected in the GUI.
The reason "drag" does not is that it's a kind of "meta-event"--
we keep a reference to the "draggable" object and check for it
on clicking the canvas. The benefit is there's a single, centralized
set of canvas events instead of event listeners for each scalar.
Drawback is that we have to manage destroying the "drag" references
in the GUI. But eventually all scalar events should be handled this
way... */
if (x->x_events.e_drag.a_flag == 1)
{
fielddesc_setfloat_const(&x->x_events.e_drag.a_attr, 0);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment