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
Aayush
purr-data
Commits
bd308c14
Commit
bd308c14
authored
Jan 31, 2016
by
Jonathan Wilkes
Browse files
clean up g_slider.c
parent
fb17c23f
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
bd308c14
...
...
@@ -2016,7 +2016,7 @@ function gui_update_numbox_text_position(cid, tag, x, y) {
});
}
function
gui_create_slider
(
cid
,
tag
,
color
,
p1
,
p2
,
p3
,
p4
,
basex
,
basey
)
{
function
gui_create_slider
(
cid
,
tag
,
x_
color
,
p1
,
p2
,
p3
,
p4
,
basex
,
basey
)
{
var
g
=
get_gobj
(
cid
,
tag
),
indicator
;
indicator
=
create_item
(
cid
,
"
line
"
,
{
...
...
@@ -2024,7 +2024,7 @@ function gui_create_slider(cid,tag,color,p1,p2,p3,p4,basex, basey) {
y1
:
p2
-
basey
,
x2
:
p3
-
basex
,
y2
:
p4
-
basey
,
stroke
:
color
,
stroke
:
x2h
(
x_
color
)
,
"
stroke-width
"
:
3
,
fill
:
"
none
"
,
id
:
tag
+
"
indicator
"
...
...
@@ -2043,10 +2043,10 @@ function gui_slider_update(cid,tag,p1,p2,p3,p4,basex,basey) {
});
}
function
gui_slider_indicator_color
(
cid
,
tag
,
color
)
{
function
gui_slider_indicator_color
(
cid
,
tag
,
x_
color
)
{
var
i
=
get_item
(
cid
,
tag
+
"
indicator
"
);
configure_item
(
i
,
{
stroke
:
color
stroke
:
x2h
(
x_
color
)
});
}
...
...
pd/src/g_slider.c
View file @
bd308c14
...
...
@@ -63,17 +63,13 @@ static void slider_draw_new(t_slider *x, t_glist *glist)
else
r
=
x1
+
3
+
(
x
->
x_val
+
50
)
/
100
;
iemgui_base_draw_new
(
&
x
->
x_gui
);
if
(
x
->
x_orient
)
{
char
colorbuf
[
MAXPDSTRING
];
sprintf
(
colorbuf
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_create_slider"
,
"xxsiiiiii"
,
gui_vmess
(
"gui_create_slider"
,
"xxxiiiiii"
,
canvas
,
x
,
colorbuf
,
x1
+
2
,
r
,
x2
-
2
,
r
,
x1
,
y1
);
x
->
x_gui
.
x_fcol
,
x1
+
2
,
r
,
x2
-
2
,
r
,
x1
,
y1
);
}
else
{
char
colorbuf
[
MAXPDSTRING
];
sprintf
(
colorbuf
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_create_slider"
,
"xxsiiiiii"
,
gui_vmess
(
"gui_create_slider"
,
"xxxiiiiii"
,
canvas
,
x
,
colorbuf
,
r
,
y1
+
2
,
r
,
y2
-
2
,
x1
,
y1
);
x
->
x_gui
.
x_fcol
,
r
,
y1
+
2
,
r
,
y2
-
2
,
x1
,
y1
);
}
}
...
...
@@ -106,10 +102,8 @@ static void slider_draw_config(t_slider *x, t_glist *glist)
{
t_canvas
*
canvas
=
glist_getcanvas
(
glist
);
iemgui_base_draw_config
(
&
x
->
x_gui
);
char
colorbuf
[
MAXPDSTRING
];
sprintf
(
colorbuf
,
"#%6.6x"
,
x
->
x_gui
.
x_fcol
);
gui_vmess
(
"gui_slider_indicator_color"
,
"xxs"
,
canvas
,
x
,
colorbuf
);
gui_vmess
(
"gui_slider_indicator_color"
,
"xxx"
,
canvas
,
x
,
x
->
x_gui
.
x_fcol
);
}
void
slider_check_minmax
(
t_slider
*
x
,
double
min
,
double
max
);
...
...
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