From 43ebc4284edf27936a1dfb0c5afdf179dd89e39e Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 30 Aug 2014 12:29:49 +0900 Subject: [PATCH] Better baseline rendering --- client/grapher.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/grapher.js b/client/grapher.js index 7e5f8b1..624b129 100644 --- a/client/grapher.js +++ b/client/grapher.js @@ -68,13 +68,6 @@ function Column(canvas, name, params, scale, range, bounds) { originX: 'center', originY: 'center', }); - - if (goog.math.Range.containsPoint(this.range, 0.0)) { - var position = this.getPosFromValue(0.0); - this.updateLine('baseline', [this.columnBounds.left, position, this.hintBounds.left, position], { - stroke: this.strokeColor - }); - } } this.updateRect('fillRect', { @@ -93,6 +86,16 @@ function Column(canvas, name, params, scale, range, bounds) { fill: this.handleColor }); + if (final && goog.math.Range.containsPoint(this.range, 0.0)) { + var w = 2; + var y = this.getPosFromValue(0.0) - w / 2; + var p = [this.columnBounds.left, y, this.hintBounds.left, y]; + this.updateLine('baseline', p, { + stroke: this.strokeColor, + strokeWidth: w + }); + } + this.canvas.renderAll(); }