]> gitweb.factorcode.org Git - factor.git/commitdiff
ui.gadgets.charts.lines: make black the default line color
authorAlexander Iljin <ajsoft@yandex.ru>
Sun, 5 Feb 2017 17:41:43 +0000 (20:41 +0300)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 17 Apr 2017 20:54:51 +0000 (13:54 -0700)
Prevent crash if the color slot is empty.

extra/ui/gadgets/charts/lines/lines.factor

index 21420fda768c6634ffbb5616e16895a18f2ced36..ea03efb08d0594abe84e66f33fc90f722bfc9147 100644 (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