untabify
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 15 Dec 2008 10:38:34 -0500
changeset 15 c18b21740d39
parent 14 696ec5de44cc
child 16 fd877bb1e6be
push id5
push userbsmedberg@mozilla.com
push dateMon, 15 Dec 2008 20:46:17 +0000
untabify
wordmap.js
--- a/wordmap.js
+++ b/wordmap.js
@@ -220,17 +220,17 @@ function hitTest(fullimg, wordimg, x, y)
     fidx = ((y + wy) * fullimg.width + x) * 4;
     for (; widx < widxend; widx += 4, fidx += 4) {
 
       // + 3 is the opacity component
       wv = wdata[widx + 3];
       fv = fdata[fidx + 3];
 
       if (wv && fv)
-	return true;
+        return true;
     }
   }
   return false;
 }
 
 function slide(fullimg, wordimg, x1, y1, x2, y2)
 {
   var hitting, steps, step, ix, iy;
@@ -263,21 +263,21 @@ function merge(fullimg, wordimg, x, y)
 
   for (wy = wordimg.height - 1; wy >= 0; --wy) {
     widx = wy * wordimg.width * 4;
     widxend = widx + (wordimg.width * 4);
 
     fidx = ((y + wy) * fullimg.width + x) * 4;
     for (; widx < widxend; widx += 4, fidx += 4) {
       if (wdata[widx + 3]) {
-	// if the word bit has opacity
-	fdata[fidx] = wdata[widx];
-	fdata[fidx + 1] = wdata[widx + 1];
-	fdata[fidx + 2] = wdata[widx + 2];
-	fdata[fidx + 3] = wdata[widx + 3];
+        // if the word bit has opacity
+        fdata[fidx] = wdata[widx];
+        fdata[fidx + 1] = wdata[widx + 1];
+        fdata[fidx + 2] = wdata[widx + 2];
+        fdata[fidx + 3] = wdata[widx + 3];
       }
     }
   }
 
   if (fullimg.minx === undefined) {
     fullimg.minx = x;
     fullimg.miny = y;
     fullimg.maxx = x + wordimg.width;
@@ -393,21 +393,21 @@ function draw(text)
     setStatus("Placing word '" + word + "': " + (i + 1) + "/" + totalcount);
     yield;
 
     vertical = Math.random() < kVerticalRatio;
     [wdata, wshadow] = drawWord(cx, word, size, vertical);
 
     for (let r in placeWord(imgdata, wshadow)) {
       if (r) {
-	[x, y] = r;
-	merge(imgdata, wdata, x, y);
+        [x, y] = r;
+        merge(imgdata, wdata, x, y);
       }
       else {
-	yield;
+        yield;
       }
     }
 
     usercx.putImageData(imgdata, 0, 0);
   }
 
   setStatus('Done!');
 }
@@ -492,9 +492,9 @@ function asyncFeedMap()
       docelement.innerHTML = entry.textContent;
       text += ' ' + docelement.textContent;
     }
 
     drawasync(text);
   };
   setStatus('Getting BSBlog feed');
   req.send(null);
-}
\ No newline at end of file
+}