summaryrefslogtreecommitdiff
path: root/src/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.js')
-rw-r--r--src/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.js b/src/main.js
index 5c9b085..d618d05 100644
--- a/src/main.js
+++ b/src/main.js
@@ -5,7 +5,7 @@ const $ = id => document.getElementById(id)
window.onload = () => {
const canvas = new Canvas('root');
- const pos = canvas.mousePos;
+ const pos = canvas.mouse.drawingPos;
canvas.onMouseMove = () => canvas.draw();
canvas.onDraw = ct => {
@@ -19,9 +19,9 @@ window.onload = () => {
ct.fillRect(2/3, 2/3, 1/3, 1/3);
ct.strokeStyle = '#fff';
- ct.lineWidth = 1/(canvas.zoom * canvas.scale);
+ ct.lineWidth = canvas.pixelsToUnits(1);
ct.beginPath();
- ct.arc(pos.x, pos.y, 30 /(canvas.zoom * canvas.scale), 0, 2*Math.PI);
+ ct.arc(pos.x, pos.y, canvas.pixelsToUnits(30), 0, 2*Math.PI);
ct.closePath();
ct.stroke();
};