Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
f372d6a4
Commit
f372d6a4
authored
Feb 09, 2016
by
Jonathan Wilkes
Browse files
fix
#9
* make scaling follow the mouse more consistently
parent
fd6c29a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/g_vumeter.c
View file @
f372d6a4
...
...
@@ -256,14 +256,18 @@ static void vu__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg mou
if
(
sh
->
h_scale
)
{
t_vu
*
x
=
(
t_vu
*
)(
sh
->
h_master
);
int
dx
=
(
int
)(
mouse_x
-
sh
->
h_offset_x
),
int
width
=
((
int
)
mouse_x
)
-
text_xpix
(
&
x
->
x_gui
.
x_obj
,
x
->
x_gui
.
x_glist
),
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
);
sh
->
h_dragx
=
dx
;
width
=
maxi
(
width
,
8
);
sh
->
h_dragx
=
width
-
x
->
x_gui
.
x_w
;
scalehandle_drag_scale
(
sh
);
x
->
x_gui
.
x_w
+
=
dx
;
x
->
x_gui
.
x_w
=
width
;
vu_check_height
(
x
,
height
);
if
(
glist_isvisible
(
x
->
x_gui
.
x_glist
))
{
...
...
@@ -278,7 +282,7 @@ static void vu__motionhook(t_scalehandle *sh, t_floatarg mouse_x, t_floatarg mou
int
properties
=
gfxstub_haveproperties
((
void
*
)
x
);
if
(
properties
)
{
int
new_w
=
x
->
x_gui
.
x_w
+
sh
->
h_dragx
;
int
new_w
=
width
;
int
new_h
=
x
->
x_gui
.
x_h
+
sh
->
h_dragy
;
properties_set_field_int
(
properties
,
"width"
,
new_w
);
properties_set_field_int
(
properties
,
"height"
,
new_h
);
...
...
Write
Preview
Markdown
is supported
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