<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>3rd-party/CREDITS</filename>
    </added>
    <added>
      <filename>3rd-party/jquery-1.2.1.min.js</filename>
    </added>
    <added>
      <filename>3rd-party/swfobject.js</filename>
    </added>
    <added>
      <filename>demo/demo.js</filename>
    </added>
    <added>
      <filename>demo/index.html</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,11 +1,13 @@
 /* Copyright 2006 Oliver Steele.  All rights reserved. */
 
-//var interval_name = setInterval('draw()',100);
-//clearInterval('animateShape()',500);
+var canvas;
+var ctx;
 
-canvas = document.getElementById(&quot;canvas&quot;);
-var ctx = canvas.getContext(&quot;2d&quot;);
-ctx.save();
+function setup(canvasElement) {
+    canvas = canvasElement;
+    ctx = canvas.getContext(&quot;2d&quot;);
+    ctx.save();
+}
 
 var Stats;
 var NewBounds;
@@ -62,9 +64,9 @@ Graphics.prototype.setViewport = function (bounds) {
 	this.ctx.restore();
 	this.clear();
 	this.ctx.save();
-	var scale = Math.min(canvas.width / (xmax - xmin),
-						 canvas.height / (ymax - ymin));
-	//info('scale = ' + scale);
+	var scale = Math.min(
+        canvas.width / (xmax - xmin || 1),
+		canvas.height / (ymax - ymin || 1));
 
 	this.ctx.scale(scale, scale);
 	this.ctx.translate(-xmin, -ymin);
@@ -190,17 +192,17 @@ function drawNext() {
     if (drawingContext.queue.length)
 		msg += &quot;  &quot; + drawingContext.queue.length + &quot; expansions remaining.&quot;;
 	if (Stats.resetCount) msg += &quot; (Reset bounds &quot; + Stats.resetCount + &quot; time&quot;+(Stats.resetCount==1?'':'s')+&quot;.)&quot;;
-	statusField.innerHTML = msg;
+	$('#statusField').html(msg);
 	
 	if (drawingContext.queue.length)
-		setTimeout('drawNext()', 10);
+		setTimeout(drawNext, 10);
 	else
 		stopRendering();
 }
 
 function stopRendering() {
 	if (drawingContext.queue.length)
-		statusField.innerHTML = &quot;&lt;font color='#ff0000'&gt;Stopped rendering&lt;/font&gt; at &quot; + Stats.shapeCount + &quot; shapes after &quot; + Math.round(((new Date).getTime() - Stats.startTime)/1000) + &quot;s, with &quot; + drawingContext.queue.length + &quot; expansions remaining.&quot;;
+		$('#statusField').html(&quot;&lt;font color='#ff0000'&gt;Stopped rendering&lt;/font&gt; at &quot; + Stats.shapeCount + &quot; shapes after &quot; + Math.round(((new Date).getTime() - Stats.startTime)/1000) + &quot;s, with &quot; + drawingContext.queue.length + &quot; expansions remaining.&quot;);
 	
 	drawingContext.queue = [];
     drawingContext = null;</diff>
      <filename>javascripts/cfdg.js</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>cfdg.html</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>91f3f34d3c820c0ad84bcdd6d4056a4702cdcd5e</id>
    </parent>
  </parents>
  <author>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </author>
  <url>http://github.com/osteele/cfdg-js/commit/b77ec2f71266624fd190635f5aabc9c47b6ccb33</url>
  <id>b77ec2f71266624fd190635f5aabc9c47b6ccb33</id>
  <committed-date>2008-03-23T11:10:29-07:00</committed-date>
  <authored-date>2008-03-23T11:10:29-07:00</authored-date>
  <message>move demo into demo directory; add jquery</message>
  <tree>9d29ff8b88254aefe26bbb8375baf102a2d1a2f9</tree>
  <committer>
    <name>Oliver Steele</name>
    <email>steele@osteele.com</email>
  </committer>
</commit>
