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
Wynn
purr-data
Commits
5c498e8a
Commit
5c498e8a
authored
May 03, 2017
by
Jonathan Wilkes
Browse files
improve logic for determining the smallest dimensions of a GOP with xlets
parent
b2382677
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/g_graph.c
View file @
5c498e8a
...
@@ -1214,14 +1214,16 @@ void graph_checkgop_rect(t_gobj *z, t_glist *glist,
...
@@ -1214,14 +1214,16 @@ void graph_checkgop_rect(t_gobj *z, t_glist *glist,
// failsafe where we cannot have a gop that is smaller than 1x1 pixels
// failsafe where we cannot have a gop that is smaller than 1x1 pixels
// regardless whether the text is hidden
// regardless whether the text is hidden
int
in
=
obj_ninlets
(
pd_checkobject
(
&
z
->
g_pd
))
*
IOWIDTH
;
int
in
=
obj_ninlets
(
pd_checkobject
(
&
z
->
g_pd
));
int
out
=
obj_noutlets
(
pd_checkobject
(
&
z
->
g_pd
))
*
IOWIDTH
;
int
out
=
obj_noutlets
(
pd_checkobject
(
&
z
->
g_pd
));
int
minhsize
=
(
in
>=
out
?
in
:
out
)
+
SCALE_GOP_MINWIDTH
;
int
max_xlets
=
in
>=
out
?
in
:
out
;
int
minvsize
=
((
in
>
0
?
1
:
0
)
+
(
out
>
0
?
1
:
0
))
*
2
+
int
minhsize
=
(
max_xlets
*
IOWIDTH
)
+
SCALE_GOP_MINHEIGHT
;
((
max_xlets
>
1
?
max_xlets
-
1
:
0
)
*
IOWIDTH
);
if
(
minhsize
<
SCALE_GOP_MINWIDTH
)
minhsize
=
SCALE_GOP_MINWIDTH
;
int
minvsize
=
((
in
>
0
?
1
:
0
)
+
(
out
>
0
?
1
:
0
))
*
2
;
if
(
minvsize
<
SCALE_GOP_MINHEIGHT
)
minvsize
=
SCALE_GOP_MINHEIGHT
;
if
(
*
xp2
<
*
xp1
+
minhsize
)
*
xp2
=
*
xp1
+
minhsize
;
if
(
*
xp2
<
*
xp1
+
minhsize
)
*
xp2
=
*
xp1
+
minhsize
;
if
(
*
yp2
<
*
yp1
+
minvsize
)
*
yp2
=
*
yp1
+
minvsize
;
if
(
*
yp2
<
*
yp1
+
minvsize
)
*
yp2
=
*
yp1
+
minvsize
;
}
}
/* get the rectangle, enlarged to contain all the "contents" --
/* get the rectangle, enlarged to contain all the "contents" --
...
...
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