diff --git a/lines/lines.factor b/lines/lines.factor index 3ae415c92d..a26d45b7b8 100644 --- a/lines/lines.factor +++ b/lines/lines.factor @@ -10,17 +10,11 @@ IN: charts.lines ! Data must be sorted by ascending x coordinate. TUPLE: line < gadget color data ; + ] 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 ] [