run setPen on start
This commit is contained in:
parent
4100c21702
commit
bf041eef75
1 changed files with 7 additions and 4 deletions
11
index.php
11
index.php
|
@ -153,6 +153,9 @@
|
||||||
const bits = document.getElementById("image-bits");
|
const bits = document.getElementById("image-bits");
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
|
// tools
|
||||||
|
var currentTool;
|
||||||
|
|
||||||
const pen = ctx.createImageData(2, 2);
|
const pen = ctx.createImageData(2, 2);
|
||||||
for (let i = 0; i < pen.data.length; i += 4) {
|
for (let i = 0; i < pen.data.length; i += 4) {
|
||||||
pen.data[i+3] = 255;
|
pen.data[i+3] = 255;
|
||||||
|
@ -165,8 +168,6 @@
|
||||||
}
|
}
|
||||||
const eraserButton = document.getElementById("eraser-button");
|
const eraserButton = document.getElementById("eraser-button");
|
||||||
|
|
||||||
var currentTool = pen;
|
|
||||||
|
|
||||||
var drawing = false;
|
var drawing = false;
|
||||||
canvas.onmousedown = function() { drawing = true; }
|
canvas.onmousedown = function() { drawing = true; }
|
||||||
document.onmouseup = function() {
|
document.onmouseup = function() {
|
||||||
|
@ -215,6 +216,8 @@
|
||||||
function clearCanvas() {
|
function clearCanvas() {
|
||||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPen();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- save most recent signature as a cookie and autoload on page load -->
|
<!-- save most recent signature as a cookie and autoload on page load -->
|
||||||
|
@ -232,14 +235,14 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--<h1 class="feed-header">Farp highlights</h1>-->
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<div class="post">
|
<div class="post">
|
||||||
Furp social is currently under construction as we implement oekaki farping. Come back soon!
|
Furp social is currently under construction as we implement oekaki farping. Come back soon!
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!--<h1 class="feed-header">Farp highlights</h1>-->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="content-column">
|
<div id="content-column">
|
||||||
|
|
Reference in a new issue