charts.lines: move (line-vertices) into private section
parent
fecae1bda6
commit
13c197aa26
|
@ -10,17 +10,11 @@ IN: charts.lines
|
||||||
! Data must be sorted by ascending x coordinate.
|
! Data must be sorted by ascending x coordinate.
|
||||||
TUPLE: line < gadget color data ;
|
TUPLE: line < gadget color data ;
|
||||||
|
|
||||||
|
<PRIVATE
|
||||||
|
|
||||||
: (line-vertices) ( seq -- vertices )
|
: (line-vertices) ( seq -- vertices )
|
||||||
concat [ 0.3 + ] float-array{ } map-as ;
|
concat [ 0.3 + ] float-array{ } map-as ;
|
||||||
|
|
||||||
: draw-line ( seq -- )
|
|
||||||
dup dup length odd? [ [ 1 head* ] dip ] [ 1 head* ] if
|
|
||||||
1 tail append
|
|
||||||
[ (line-vertices) gl-vertex-pointer GL_LINES 0 ] keep
|
|
||||||
length glDrawArrays ;
|
|
||||||
|
|
||||||
<PRIVATE
|
|
||||||
|
|
||||||
: search-index ( elt seq -- index elt )
|
: search-index ( elt seq -- index elt )
|
||||||
[ first <=> ] with search ;
|
[ first <=> ] with search ;
|
||||||
|
|
||||||
|
@ -67,6 +61,12 @@ TUPLE: line < gadget color data ;
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
: draw-line ( seq -- )
|
||||||
|
dup dup length odd? [ [ 1 head* ] dip ] [ 1 head* ] if
|
||||||
|
1 tail append
|
||||||
|
[ (line-vertices) gl-vertex-pointer GL_LINES 0 ] keep
|
||||||
|
length glDrawArrays ;
|
||||||
|
|
||||||
! bounds: { { first-min first-max } { second-min second-max } }
|
! bounds: { { first-min first-max } { second-min second-max } }
|
||||||
: clip-data ( bounds data -- data' )
|
: clip-data ( bounds data -- data' )
|
||||||
dup empty? [ nip ] [
|
dup empty? [ nip ] [
|
||||||
|
|
Loading…
Reference in New Issue