charts.lines: move (line-vertices) into private section

char-rename
Alexander Iljin 2017-01-08 14:12:52 +03:00 committed by John Benediktsson
parent fecae1bda6
commit 13c197aa26
1 changed files with 8 additions and 8 deletions

View File

@ -10,17 +10,11 @@ IN: charts.lines
! Data must be sorted by ascending x coordinate.
TUPLE: line < gadget color data ;
<PRIVATE
: (line-vertices) ( seq -- vertices )
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 )
[ first <=> ] with search ;
@ -67,6 +61,12 @@ TUPLE: line < gadget color data ;
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 } }
: clip-data ( bounds data -- data' )
dup empty? [ nip ] [