ui.gadgets.charts.lines: make black the default line color

Prevent crash if the color slot is empty.
char-rename
Alexander Iljin 2017-02-05 20:41:43 +03:00 committed by John Benediktsson
parent 90a7ce9120
commit c91d7dbcb9
1 changed files with 6 additions and 5 deletions

View File

@ -1,9 +1,10 @@
! Copyright (C) 2016-2017 Alexander Ilin.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs binary-search combinators
combinators.short-circuit fry kernel locals make math math.order
math.statistics math.vectors namespaces opengl opengl.gl
sequences specialized-arrays.instances.alien.c-types.float
USING: accessors arrays assocs binary-search colors.constants
combinators combinators.short-circuit fry kernel locals make
math math.order math.statistics math.vectors namespaces opengl
opengl.gl sequences
specialized-arrays.instances.alien.c-types.float
splitting.monotonic ui.gadgets ui.gadgets.charts
ui.gadgets.charts.utils ui.render ;
IN: ui.gadgets.charts.lines
@ -245,7 +246,7 @@ PRIVATE>
M: line draw-gadget*
dup parent>> dup chart? [| line chart |
chart chart-axes
line [ color>> gl-color ] [ data>> ] bi
COLOR: black line [ default-color ] [ data>> ] bi
dupd clip-data swap second [ drawable-chunks ] keep
flip-y-axis
chart chart-dim first2 [ chart chart-axes first2 ] dip swap