Skip to content

Commit 191de8b

Browse files
committed
adding comments
1 parent 3d8481f commit 191de8b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

08 - Fun with HTML5 Canvas/index-START.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
}
3838

3939
var draw = function(e) {
40+
// master drawing function
4041
if (!isDrawing) {
4142
return;
4243
}
@@ -62,10 +63,15 @@
6263
hue %= 360;
6364
}
6465

66+
// event handlers
6567
canvas.addEventListener('mousedown', startDrawing);
6668
canvas.addEventListener('mousemove', draw);
6769
canvas.addEventListener('mouseup', stopDrawing);
6870
canvas.addEventListener('mouseout', stopDrawing);
71+
72+
// TODO: on mobile, finger pressure determines width?
73+
// TODO: A LOT more configurable and less random
74+
6975
</script>
7076

7177
<style>

0 commit comments

Comments
 (0)