mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-08-28 22:30:04 -04:00
fix lint errors in playground
This commit is contained in:
parent
ad1831ebfa
commit
65fca3e3c7
2 changed files with 8 additions and 8 deletions
|
@ -37,7 +37,7 @@ image.src = 'https://cdn.assets.scratch.mit.edu/internalapi/asset/7e24c99c1b853e
|
|||
|
||||
// SVG (cat 1-a)
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.addEventListener('load', function () {
|
||||
xhr.addEventListener('load', () => {
|
||||
const skinId = renderer.createSVGSkin(xhr.responseText);
|
||||
if (wantedSkin === WantedSkinType.vector) {
|
||||
renderer.updateDrawableProperties(drawableID2, {
|
||||
|
@ -56,10 +56,10 @@ if (wantedSkin === WantedSkinType.pen) {
|
|||
});
|
||||
|
||||
canvas.addEventListener('click', event => {
|
||||
let rect = canvas.getBoundingClientRect();
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
|
||||
let x = event.clientX - rect.left;
|
||||
let y = event.clientY - rect.top;
|
||||
const x = event.clientX - rect.left;
|
||||
const y = event.clientY - rect.top;
|
||||
|
||||
renderer.penLine(penSkinID, {
|
||||
color4f: [Math.random(), Math.random(), Math.random(), 1],
|
||||
|
@ -184,7 +184,7 @@ canvas.addEventListener('mousemove', event => {
|
|||
canvas.addEventListener('click', event => {
|
||||
const mousePos = getMousePosition(event, canvas);
|
||||
const pickID = renderer.pick(mousePos.x, mousePos.y);
|
||||
console.log('You clicked on ' + (pickID < 0 ? 'nothing' : 'ID# ' + pickID));
|
||||
console.log(`You clicked on ${(pickID < 0 ? 'nothing' : `ID#${pickID}`)}`);
|
||||
if (pickID >= 0) {
|
||||
console.dir(renderer.extractDrawable(pickID, mousePos.x, mousePos.y));
|
||||
}
|
||||
|
|
|
@ -92,9 +92,9 @@ renderCanvas.addEventListener('click', event => {
|
|||
}
|
||||
});
|
||||
|
||||
const rgb2fillStyle = (rgb) => {
|
||||
return `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;
|
||||
};
|
||||
const rgb2fillStyle = rgb => (
|
||||
`rgb(${rgb[0]},${rgb[1]},${rgb[2]})`
|
||||
);
|
||||
|
||||
const makeCursorImage = () => {
|
||||
const canvas = document.createElement('canvas');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue