Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Giulio
purr-data
Commits
5c498e8a
Commit
5c498e8a
authored
May 03, 2017
by
Jonathan Wilkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve logic for determining the smallest dimensions of a GOP with xlets
parent
b2382677
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
pd/src/g_graph.c
pd/src/g_graph.c
+8
-6
No files found.
pd/src/g_graph.c
View file @
5c498e8a
...
...
@@ -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
// regardless whether the text is hidden
int
in
=
obj_ninlets
(
pd_checkobject
(
&
z
->
g_pd
))
*
IOWIDTH
;
int
out
=
obj_noutlets
(
pd_checkobject
(
&
z
->
g_pd
))
*
IOWIDTH
;
int
minhsize
=
(
in
>=
out
?
in
:
out
)
+
SCALE_GOP_MINWIDTH
;
int
minvsize
=
((
in
>
0
?
1
:
0
)
+
(
out
>
0
?
1
:
0
))
*
2
+
SCALE_GOP_MINHEIGHT
;
int
in
=
obj_ninlets
(
pd_checkobject
(
&
z
->
g_pd
));
int
out
=
obj_noutlets
(
pd_checkobject
(
&
z
->
g_pd
));
int
max_xlets
=
in
>=
out
?
in
:
out
;
int
minhsize
=
(
max_xlets
*
IOWIDTH
)
+
((
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
(
*
yp2
<
*
yp1
+
minvsize
)
*
yp2
=
*
yp1
+
minvsize
;
}
/* 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