liquid-tank
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -143,3 +143,3 @@ (function() { | ||
ctx.strokeStyle = _getBorderColor(options); | ||
if (options.segments) { | ||
if (options.segments && options.segments.length) { | ||
ctx.fillStyle = _getGradientFillStyle(canvas, options); | ||
@@ -152,3 +152,3 @@ } | ||
canvas.width, | ||
canvas.height - lineHeight, | ||
canvas.height - lineHeight - 8, | ||
{ lowerLeft: 24, lowerRight: 24 }, | ||
@@ -181,3 +181,3 @@ false, | ||
ctx.fillStyle = _getTextColor(options); | ||
ctx.fillText(textValue, canvas.width * 0.5, canvas.height - 8); | ||
ctx.fillText(textValue, canvas.width * 0.5, canvas.height - 16); | ||
} | ||
@@ -217,3 +217,3 @@ | ||
var canvasWidth = canvas.width; | ||
var height = canvasHeight - options._lineHeight; | ||
var height = canvasHeight - options._lineHeight - 8; | ||
var width = canvasWidth; | ||
@@ -238,3 +238,3 @@ var min = options.min; | ||
var ctx = canvas.getContext("2d"); | ||
var height = canvas.height - options._lineHeight; | ||
var height = canvas.height - options._lineHeight - 8; | ||
var gradient = ctx.createLinearGradient(10, height - 10, 10, 10); | ||
@@ -246,3 +246,3 @@ var min = options.min; | ||
var _segments = []; | ||
if (segments.length) { | ||
if (segments && segments.length) { | ||
for (i = 0; i < segments.length; i++) { | ||
@@ -249,0 +249,0 @@ var prevEndValue = i === 0 ? min : segments[i - 1].endValue; |
{ | ||
"name": "liquid-tank", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "liquid-tank.js", |
14011