Handbook
Glossary
(rounded-rect-vertices) ( loc dim radius -- vertices )
Vocabulary
ui
.
pens
.
rounded
Inputs
loc
an
object
dim
an
object
radius
an
object
Outputs
vertices
an
object
Definition
USING:
columns
kernel
make
math
math.vectors
sequences
specialized-arrays.instances.alien.c-types.float
ui.pens.rounded.private
;
IN:
ui.pens.rounded
::
(rounded-rect-vertices)
( loc dim radius -- vertices )
loc dim
[
first2
]
bi@
:>
( x y w h ) radius w h
clamp-radius
:>
r
[
x r
+
,
y
,
x w
+
r
-
,
y
,
corner-point-count
unit-rounded-corners
[
0
<column>
r
neg
v*n
x w
+
v+n
]
[
1
<column>
r
v*n
y
v+n
]
bi
alternate
%
x w
+
,
y r
+
,
x w
+
,
y h
+
r
-
,
corner-point-count
unit-rounded-corners
[
0
<column>
<reversed>
r
neg
v*n
x w
+
v+n
]
[
1
<column>
<reversed>
r
neg
v*n
y h
+
v+n
]
bi
alternate
%
x w
+
r
-
,
y h
+
,
x r
+
,
y h
+
,
corner-point-count
unit-rounded-corners
[
0
<column>
r
v*n
x
v+n
]
[
1
<column>
r
neg
v*n
y h
+
v+n
]
bi
alternate
%
x
,
y h
+
r
-
,
x
,
y r
+
,
corner-point-count
unit-rounded-corners
[
0
<column>
<reversed>
r
v*n
x
v+n
]
[
1
<column>
<reversed>
r
v*n
y
v+n
]
bi
alternate
%
]
float-array{
}
make
;