Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 heatmap.js
7 heatmap.js
... ... @@ -1,6 +1,8 @@
1 1 $(function () {
2 2 var heat = {},
3 3 canvas = $('#overlay'),
  4 + canvasWidth,
  5 + canvasHeight,
4 6 context = canvas.get(0).getContext('2d'),
5 7 cache = { toHue: {}, hueToRGB: {} },
6 8 normalizeHeat,
@@ -32,11 +34,12 @@ $(function () {
32 34 width: $('#result').width(),
33 35 height: $('#result').height()
34 36 });
  37 +
  38 + canvasWidth = canvas.attr('width');
  39 + canvasHeight = canvas.attr('height');
35 40
36 41 applyMask = function (mask, eventX, eventY) {
37 42 var key, i, j, initialI, initialJ,
38   - canvasWidth = canvas.attr('width'),
39   - canvasHeight = canvas.attr('height'),
40 43 maskSeg;
41 44
42 45 // mask segment size: (length - 1) / 2, length should be odd

0 comments on commit 10c2517

Please sign in to comment.
Something went wrong with that request. Please try again.