<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -25,9 +25,9 @@ var y = 250;
 var dx = 1.5;
 var dy = -4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
-var paddlex = WIDTH / 2;
+var WIDTH;
+var HEIGHT;
+var paddlex;
 var paddleh = 10;
 var paddlew = 75;
 var rightDown = false;
@@ -38,14 +38,18 @@ var intervalId = 0;
 var bricks;
 var NROWS = 5;
 var NCOLS = 5;
-var BRICKWIDTH = (WIDTH/NCOLS) - 1;
+var BRICKWIDTH;
 var BRICKHEIGHT = 15;
 var PADDING = 1;
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width();
+  HEIGHT = $(&quot;#canvas&quot;).height();
+  BRICKWIDTH = (WIDTH/NCOLS) - 1;
+  paddlex = WIDTH / 2;
   canvasMinX = $(&quot;#canvas&quot;).offset().left;
-  canvasMaxX = canvasMinX + $(&quot;#canvas&quot;).width();
+  canvasMaxX = canvasMinX + WIDTH;
   intervalId = setInterval(draw, 10);
   return intervalId;
 }
@@ -271,12 +275,14 @@ var x = 150;
 var y = 150;
 var dx = 2;
 var dy = 4;
+var WIDTH;
+var HEIGHT;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width();
+  HEIGHT = $(&quot;#canvas&quot;).height();
   return setInterval(draw, 10);
 }
 
@@ -340,8 +346,8 @@ var y = 150;
 var dx = 2;
 var dy = 4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
+var WIDTH; 
+var HEIGHT;
 
 function circle(x,y,r) {
   ctx.beginPath();
@@ -363,6 +369,8 @@ function clear() {
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width()
+  HEIGHT = $(&quot;#canvas&quot;).height()
   return setInterval(draw, 10);
 }&quot;&quot;&quot;
 },
@@ -408,8 +416,8 @@ var y = 150;
 var dx = 2;
 var dy = 4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
+var WIDTH;
+var HEIGHT;
 var intervalId = 0;
 
 function circle(x,y,r) {
@@ -432,6 +440,8 @@ function clear() {
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width()
+  HEIGHT = $(&quot;#canvas&quot;).height()
   intervalId = setInterval(draw, 10);
   return intervalId;
 }&quot;&quot;&quot;
@@ -500,9 +510,9 @@ var y = 150;
 var dx = 2;
 var dy = 4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
-var paddlex = WIDTH / 2;
+var WIDTH;
+var HEIGHT;
+var paddlex;
 var paddleh = 10;
 var paddlew = 75;
 var intervalId = 0;
@@ -527,6 +537,9 @@ function clear() {
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width()
+  HEIGHT = $(&quot;#canvas&quot;).height()
+  paddlex = WIDTH / 2;
   intervalId = setInterval(draw, 10);
   return intervalId;
 }&quot;&quot;&quot;
@@ -538,7 +551,7 @@ function init() {
     function, see if the mouse is within the borders of the game,
     and move the paddle if it is.&quot;&quot;&quot;,
 &quot;code&quot;: &quot;&quot;&quot;var canvasMinX = $(&quot;#canvas&quot;).offset().left;
-var canvasMaxX = canvasMinX + $(&quot;#canvas&quot;).width();
+var canvasMaxX = canvasMinX + WIDTH;
 
 function onMouseMove(evt) {
   if (evt.pageX &amp;gt; canvasMinX &amp;amp;&amp;amp; evt.pageX &amp;lt; canvasMaxX) {
@@ -584,9 +597,9 @@ var y = 150;
 var dx = 2;
 var dy = 4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
-var paddlex = WIDTH / 2;
+var WIDTH;
+var HEIGHT;
+var paddlex;
 var paddleh = 10;
 var paddlew = 75;
 var rightDown = false;
@@ -628,8 +641,11 @@ $(document).keyup(onKeyUp);
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width()
+  HEIGHT = $(&quot;#canvas&quot;).height()
+  paddlex = WIDTH / 2;
   canvasMinX = $(&quot;#canvas&quot;).offset().left;
-  canvasMaxX = canvasMinX + $(&quot;#canvas&quot;).width();
+  canvasMaxX = canvasMinX + WIDTH;
   intervalId = setInterval(draw, 10);
   return intervalId;
 }&quot;&quot;&quot;
@@ -719,9 +735,9 @@ var y = 250;
 var dx = 1.5;
 var dy = -4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
-var paddlex = WIDTH / 2;
+var WIDTH;
+var HEIGHT;
+var paddlex;
 var paddleh = 10;
 var paddlew = 75;
 var rightDown = false;
@@ -771,8 +787,11 @@ $(document).mousemove(onMouseMove);
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width()
+  HEIGHT = $(&quot;#canvas&quot;).height()
+  paddlex = WIDTH / 2;
   canvasMinX = $(&quot;#canvas&quot;).offset().left;
-  canvasMaxX = canvasMinX + $(&quot;#canvas&quot;).width();
+  canvasMaxX = canvasMinX + WIDTH;
   intervalId = setInterval(draw, 10);
   return intervalId;
 }&quot;&quot;&quot;
@@ -842,9 +861,9 @@ var y = 250;
 var dx = 1.5;
 var dy = -4;
 var ctx;
-var WIDTH = $(&quot;#canvas&quot;).width()
-var HEIGHT = $(&quot;#canvas&quot;).height()
-var paddlex = WIDTH / 2;
+var WIDTH;
+var HEIGHT;
+var paddlex;
 var paddleh = 10;
 var paddlew = 75;
 var rightDown = false;
@@ -855,14 +874,18 @@ var intervalId = 0;
 var bricks;
 var NROWS = 5;
 var NCOLS = 5;
-var BRICKWIDTH = (WIDTH/NCOLS) - 1;
+var BRICKWIDTH;
 var BRICKHEIGHT = 15;
 var PADDING = 1;
 
 function init() {
   ctx = $('#canvas')[0].getContext(&quot;2d&quot;);
+  WIDTH = $(&quot;#canvas&quot;).width();
+  HEIGHT = $(&quot;#canvas&quot;).height();
+  paddlex = WIDTH / 2;
+  BRICKWIDTH = (WIDTH/NCOLS) - 1;
   canvasMinX = $(&quot;#canvas&quot;).offset().left;
-  canvasMaxX = canvasMinX + $(&quot;#canvas&quot;).width();
+  canvasMaxX = canvasMinX + WIDTH;
   intervalId = setInterval(draw, 10);
   return intervalId;
 }</diff>
      <filename>tutorial/data.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6a29ed65b89815f2dffc4175b5b7308249ce5036</id>
    </parent>
  </parents>
  <author>
    <name>Bill Mill</name>
    <email>bill.mill@gmail.com</email>
  </author>
  <url>http://github.com/llimllib/refresh-canvas/commit/bfb33b35258836d74aed2867520959e875a4df44</url>
  <id>bfb33b35258836d74aed2867520959e875a4df44</id>
  <committed-date>2009-08-05T16:02:28-07:00</committed-date>
  <authored-date>2009-08-05T16:02:28-07:00</authored-date>
  <message>fixing WIDTH issues</message>
  <tree>7885db92583a5b5a20323131ca06dfb58557aea2</tree>
  <committer>
    <name>Bill Mill</name>
    <email>bill.mill@gmail.com</email>
  </committer>
</commit>
