1

Better baseline rendering

This commit is contained in:
Alex Yatskov 2014-08-30 12:29:49 +09:00
parent 943e4b0d08
commit 43ebc4284e

View File

@ -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();
}