Skip to content

Commit

Permalink
Fixed issue Mikhus#101 - problem with running linear gauges in IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhus committed Jan 10, 2017
1 parent 4016277 commit d7fce9b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions gauge.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gauge.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions lib/LinearGauge.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ function drawLinearTicks(context, color, ticks, minVal, maxVal,
let tickOffset = (width - barWidth) / 2;
let tickX, tickY;
let i = 0;
let s = ticks.length;
let val;
let tickLen = lineLength * width;
let tickLeft = tickOffset - ticksPadding * width;
let tickRight = tickOffset + barWidth + tickLen + ticksPadding * width;
Expand All @@ -615,8 +617,9 @@ function drawLinearTicks(context, color, ticks, minVal, maxVal,
context.save();

let ratio = ticksLength / (maxVal - minVal);
for (let val of ticks) {
context.strokeStyle = colors[ticks.indexOf(val)];
for (; i < s; i++) {
val = ticks[i];
context.strokeStyle = colors[i];

if (isVertical) {
tickY = Y + length - barMargin - barOffset
Expand Down
2 changes: 1 addition & 1 deletion test-coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d7fce9b

Please sign in to comment.