This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawLine() { | |
var a = prevX, a_ = a, | |
b = prevY, b_ = h-b, | |
c = currX, c_ = c, | |
d = currY, d_ = h-d; | |
//...code... | |
context.moveTo(a, b); | |
context.lineTo(c, d); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawLine() { | |
var a = prevX, a_ = a, | |
b = prevY, b_ = h-b, | |
c = currX, c_ = c, | |
d = currY, d_ = h-d; | |
//... code ... | |
context.moveTo(a, b); | |
context.lineTo(c, d); | |
context.moveTo(a_, b_); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColor() { | |
return document.querySelector(".color").value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawLine() { | |
//...code... | |
context.strokeStyle = getColor(); | |
context.lineWidth = 4; | |
context.lineCap = "round"; | |
//...code... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<script src="main.js"></script> | |
</head> | |
<body onload="init()"> | |
<canvas width="600" height="600"> | |
<p>Your browser doesn't support canvas.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawLine() { | |
var a = prevX, | |
b = prevY, | |
c = currX, | |
d = currY; | |
context.lineWidth = 4; | |
context.lineCap = "round"; | |
context.beginPath(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<script src="main.js"></script> | |
</head> | |
<body onload="init()"> | |
<canvas width="600" height="600"> | |
<p>Your browser doesn't support canvas.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
background-color: #ccc; | |
text-align: center; | |
} | |
canvas { | |
touch-action: none; | |
background-color: #fff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
√סבכ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<script src="main.js"></script> | |
</head> | |
<body onload="init()"> | |
<div> | |
<div class="canvas-container"> |