Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

move canvas width and height into a spot where more things can use them.

  • Loading branch information...
commit 10c25177dfbbcee78dae81534d0fda64ffc168e9 1 parent 495fbe9
mpd authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 heatmap.js
View
7 heatmap.js
@@ -1,6 +1,8 @@
$(function () {
var heat = {},
canvas = $('#overlay'),
+ canvasWidth,
+ canvasHeight,
context = canvas.get(0).getContext('2d'),
cache = { toHue: {}, hueToRGB: {} },
normalizeHeat,
@@ -32,11 +34,12 @@ $(function () {
width: $('#result').width(),
height: $('#result').height()
});
+
+ canvasWidth = canvas.attr('width');
+ canvasHeight = canvas.attr('height');
applyMask = function (mask, eventX, eventY) {
var key, i, j, initialI, initialJ,
- canvasWidth = canvas.attr('width'),
- canvasHeight = canvas.attr('height'),
maskSeg;
// mask segment size: (length - 1) / 2, length should be odd
Please sign in to comment.
Something went wrong with that request. Please try again.