Commit e6b2ceb4 authored by Ryan Davis's avatar Ryan Davis

add a new draw-graph-outline to just stroke the outline at the end, instead of...

add a new draw-graph-outline to just stroke the outline at the end, instead of filling with transparent color when drawing the outline.  This is about a 2x speedup on my test graphs.

darcs-hash:20090616213929-ac9f3-59cae145ef92ae016e71c41b7d3e64d79e6c17f7.gz
parent fcb34750
......@@ -199,8 +199,8 @@ the Y axis")))
y-axis-labels-x
gy)))))
(defun draw-graph-area (graph &optional (border-only nil))
"draws the graph aread"
(defun draw-graph-area (graph)
"draws the graph area"
(with-graphics-state
;;set the chart background as the avg
;;between the background color and 1
......@@ -208,16 +208,21 @@ the Y axis")))
(set-rgb-stroke 0 0 0)
(rectangle (1- (x graph)) (1- (y graph))
(1+ (width graph)) (1+ (height graph)))
(if border-only
(set-rgba-fill 0 0 0 0)
(set-fill (mapcar #'(lambda (c)
(/ (+ (if (eq 1 c)
.7
1) c) 2))
(background (chart graph)))))
(set-fill (mapcar #'(lambda (c)
(/ (+ (if (eq 1 c) .7 1)
c)
2))
(background (chart graph))))
(fill-and-stroke)))
(defun draw-graph-outline (graph)
(with-graphics-state
(set-rgb-stroke 0 0 0)
(rectangle (1- (x graph)) (1- (y graph))
(1+ (width graph)) (1+ (height graph)))
(stroke)))
(defmethod dp->gp ((graph graph-region) x y)
"convert a point from data space to graph space"
......@@ -325,7 +330,7 @@ the Y axis")))
;;TODO: make this a property of the series
(draw-series chart graph)
(draw-graph-area graph T))))))
(draw-graph-outline graph))))))
(defgeneric draw-series (chart graph))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment