Handbook
Glossary
rounded
Vocabulary
ui
.
pens
.
rounded
Definition
USING:
ui.pens.solid
;
IN:
ui.pens.rounded
TUPLE:
rounded
<
solid
radius
;
Methods
USING:
accessors
kernel
math
namespaces
opengl
opengl.gl
sequences
ui.pens
ui.pens.rounded
ui.pens.rounded.private
ui.render
;
M:
rounded
draw-boundary
[
(rounded)
]
[
boundary-vertices>>
]
bi
gl3-mode?
get-global
[
[
upload-vertices
]
[
length
6
/i
]
bi
GL_LINE_STRIP
0
rot
glDrawArrays
]
[
[
gl-vertex-pointer
]
[
length
2/
]
bi
GL_LINE_STRIP
0
rot
glDrawArrays
]
if
;
USING:
accessors
kernel
math
namespaces
opengl
opengl.gl
sequences
ui.pens
ui.pens.rounded
ui.pens.rounded.private
ui.render
;
M:
rounded
draw-interior
[
(rounded)
]
[
interior-vertices>>
]
bi
gl3-mode?
get-global
[
[
upload-vertices
]
[
length
6
/i
]
bi
GL_TRIANGLE_FAN
0
rot
glDrawArrays
]
[
[
gl-vertex-pointer
]
[
length
2/
]
bi
GL_POLYGON
0
rot
glDrawArrays
]
if
;
USING:
accessors
kernel
namespaces
opengl
ui.pens.caching
ui.pens.polygon
ui.pens.rounded
ui.pens.rounded.private
;
M:
rounded
recompute-pen
swap
over
[
dim>>
]
[
radius>>
]
bi*
[
[
{
0 0
}
]
2dip
(rounded-rect-vertices)
close-path
>>interior-vertices
]
[
[
{
0 0
}
swap
boundary-shift
]
dip
(rounded-rect-vertices)
>>boundary-vertices
]
2bi
gl3-mode?
get-global
[
dup
color>>
[
flat-xy-to-gl3-vertices
]
curry
[
change-interior-vertices
]
[
change-boundary-vertices
]
bi
]
when
drop
;