Skip to content
Snippets Groups Projects
Commit 1d458503 authored by deepdigger's avatar deepdigger
Browse files

change incorrect jsdoc, made functions private, fixed function name, changed Object name

parent cdf4d323
1 merge request!8Merge Changes into custom-server, mainly paint-functionality
......@@ -343,13 +343,13 @@ export default class SkribblCanvas extends CustomElement {
return colorAtPosition;
}
getImageData = /**
/**
* @param {number} someWidth
* @param {number} someHeight
* @param {number} n
* @param {number} o
*/
function (someWidth, someHeight, n, o) {
getImageData(someWidth, someHeight, n, o) {
var r = Math.min(someWidth, n)
, s = Math.min(someHeight, o)
, i = Math.abs(someWidth - n)
......@@ -358,28 +358,30 @@ export default class SkribblCanvas extends CustomElement {
return ctx.getImageData(r, s, i, getRGBValuesFromString)
};
setPixel = /**
/**
* @param {{ data: number[]; }} someWidth
* @param {number} someHeight
* @param {any} n
* @param {any} o
* @param {any} r
*/
function (someWidth, someHeight, n, o, r) {
setPixel (someWidth, someHeight, n, o, r) {
someHeight >= 0 && someHeight < someWidth.data.length && (someWidth.data[someHeight] = n,
someWidth.data[someHeight + 1] = o,
someWidth.data[someHeight + 2] = r,
someWidth.data[someHeight + 3] = 255)
someWidth.data[someHeight + 1] = o,
someWidth.data[someHeight + 2] = r,
someWidth.data[someHeight + 3] = 255)
}
getPixel = /**
/**
* @param {{ width: number; data: number[]; }} someWidth
* @param {number} someHeight
* @param {number} n
*/
function (someWidth, someHeight, n) {
var o = 4 * (n * someWidth.width + someHeight);
return o >= 0 && o < someWidth.data.length ? [someWidth.data[o], someWidth.data[o + 1], someWidth.data[o + 2]] : [0, 0, 0]
getPixel(someWidth, someHeight, n) {
var position = 4 * (n * someWidth.width + someHeight);
return position >= 0 && position < someWidth.data.length ? [someWidth.data[position], someWidth.data[position + 1], someWidth.data[position + 2]] : [0, 0, 0]
};
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment