charts.lines: drop slices that are out of y range in drawable-chunks

char-rename
Alexander Iljin 2017-01-13 17:51:42 +03:00 committed by John Benediktsson
parent cb2fbac778
commit ff0c2fdf32
1 changed files with 4 additions and 2 deletions

View File

@ -110,8 +110,10 @@ TUPLE: line < gadget color data ;
! Return the (empty?) sequence of chunks, possibly with some new ! Return the (empty?) sequence of chunks, possibly with some new
! points at ymin and ymax at the gap bounds. ! points at ymin and ymax at the gap bounds.
: drawable-chunks ( data ymin,ymax -- chunks ) : drawable-chunks ( data ymin,ymax -- chunks )
first2 '[ [ second _ _ between<=> ] bi@ = ] first2 [
monotonic-split-slice ; '[ [ second _ _ between<=> ] bi@ = ]
monotonic-split-slice
] 2keep '[ first second _ _ between? not ] reject ;
PRIVATE> PRIVATE>