Skip to content
Snippets Groups Projects
Commit 2d5d8d26 authored by Ray Schamp's avatar Ray Schamp
Browse files

Use let where applicable

Copy-paste-laziness
parent bbbb2bc2
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,8 @@ module.exports = { ...@@ -17,8 +17,8 @@ module.exports = {
}, },
attachMouseEvents: function (vm, stage) { attachMouseEvents: function (vm, stage) {
document.addEventListener('mousemove', function (e) { document.addEventListener('mousemove', function (e) {
var rect = stage.getBoundingClientRect(); let rect = stage.getBoundingClientRect();
var coordinates = { let coordinates = {
x: e.clientX - rect.left, x: e.clientX - rect.left,
y: e.clientY - rect.top, y: e.clientY - rect.top,
canvasWidth: rect.width, canvasWidth: rect.width,
...@@ -27,8 +27,8 @@ module.exports = { ...@@ -27,8 +27,8 @@ module.exports = {
vm.postIOData('mouse', coordinates); vm.postIOData('mouse', coordinates);
}); });
stage.addEventListener('mousedown', function (e) { stage.addEventListener('mousedown', function (e) {
var rect = stage.getBoundingClientRect(); let rect = stage.getBoundingClientRect();
var data = { let data = {
isDown: true, isDown: true,
x: e.clientX - rect.left, x: e.clientX - rect.left,
y: e.clientY - rect.top, y: e.clientY - rect.top,
...@@ -39,8 +39,8 @@ module.exports = { ...@@ -39,8 +39,8 @@ module.exports = {
e.preventDefault(); e.preventDefault();
}); });
stage.addEventListener('mouseup', function (e) { stage.addEventListener('mouseup', function (e) {
var rect = stage.getBoundingClientRect(); let rect = stage.getBoundingClientRect();
var data = { let data = {
isDown: false, isDown: false,
x: e.clientX - rect.left, x: e.clientX - rect.left,
y: e.clientY - rect.top, y: e.clientY - rect.top,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment