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
nerrons
purr-data
Commits
b56992f0
Commit
b56992f0
authored
Feb 05, 2016
by
Jonathan Wilkes
Browse files
fix vu regressions, and make scaling logic more friendly (still needs testing)
parent
83751230
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
b56992f0
...
...
@@ -2214,11 +2214,13 @@ function gui_update_vumeter_rect(cid, tag, x_color) {
// Oh hack upon hack... why doesn't the iemgui base_config just take care
// of this?
function
gui_vumeter_border_coords
(
cid
,
tag
,
width
,
height
)
{
var
r
=
get_item
(
cid
,
tag
+
"
border
"
);
function
gui_vumeter_border_size
(
cid
,
tag
,
width
,
height
)
{
var
g
=
get_gobj
(
cid
,
tag
),
r
;
// also need to check for existence-- apparently the iemgui
// dialog will delete the vu and try to set this before recreating it...
if
(
r
)
{
if
(
g
)
{
r
=
g
.
querySelector
(
"
.border
"
);
configure_item
(
r
,
{
width
:
width
,
height
:
height
});
}
}
...
...
pd/src/g_vumeter.c
View file @
b56992f0
...
...
@@ -178,7 +178,7 @@ static void vu_draw_move(t_vu *x, t_glist *glist)
int
k1
=
x
->
x_led_size
+
1
,
k2
=
IEM_VU_STEPS
+
1
,
k3
=
k1
/
2
;
int
yyy
,
i
,
k4
=
y1
-
k3
;
gui_vmess
(
"gui_vumeter_border_
coords
"
,
"xxii"
,
gui_vmess
(
"gui_vumeter_border_
size
"
,
"xxii"
,
canvas
,
x
,
x
->
x_gui
.
x_w
+
2
,
x
->
x_gui
.
x_h
+
4
);
for
(
i
=
1
;
i
<=
IEM_VU_STEPS
;
i
++
)
{
...
...
@@ -257,16 +257,14 @@ static void vu__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg mou
{
t_vu
*
x
=
(
t_vu
*
)(
sh
->
h_master
);
int
dx
=
(
int
)(
mouse_x
-
sh
->
h_offset_x
),
dy
=
(
int
)(
mouse_y
-
sh
->
h_offset_y
);
height
=
((
int
)
mouse_y
)
-
text_ypix
(
&
x
->
x_gui
.
x_obj
,
x
->
x_gui
.
x_glist
);
dx
=
maxi
(
dx
,
8
-
x
->
x_gui
.
x_w
);
dy
=
maxi
(
dy
,
80
-
x
->
x_gui
.
x_h
);
sh
->
h_dragx
=
dx
;
sh
->
h_dragy
=
dy
;
scalehandle_drag_scale
(
sh
);
x
->
x_gui
.
x_w
+=
dx
;
x
->
x_gui
.
x_h
+=
dy
;
vu_check_height
(
x
,
height
);
if
(
glist_isvisible
(
x
->
x_gui
.
x_glist
))
{
/* draw_move doesn't seem to cut it for vu, so we
...
...
@@ -530,6 +528,7 @@ static void vu_dialog(t_vu *x, t_symbol *s, int argc, t_atom *argv)
canvas_apply_setundo
(
x
->
x_gui
.
x_glist
,
(
t_gobj
*
)
x
);
int
w
=
atom_getintarg
(
0
,
argc
,
argv
);
int
h
=
atom_getintarg
(
1
,
argc
,
argv
);
int
scale
=
!!
atom_getintarg
(
4
,
argc
,
argv
);
int
sr_flags
=
iemgui_dialog
(
&
x
->
x_gui
,
argc
,
argv
);
x
->
x_gui
.
x_loadinit
=
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