diff --git a/.vscode/settings.json b/.vscode/settings.json index 8294480..33ffd9d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -364,6 +364,7 @@ "Satanas", "Scribus", "scrollable", + "scrollbars", "Sesotho", "Setswana", "shader's", @@ -449,6 +450,7 @@ "Valoda", "vaporwave", "Venda", + "Verdana", "verts", "Viacam", "Việt", diff --git a/help/vaporwave.js b/help/vaporwave.js index b602277..47415b1 100644 --- a/help/vaporwave.js +++ b/help/vaporwave.js @@ -12,10 +12,10 @@ const ctx = canvas.getContext("2d"); const animate = () => { rAF_ID = requestAnimationFrame(animate); - if( - canvas.width !== mask_img.width || + if ( + canvas.width !== mask_img.width || canvas.height !== mask_img.height - ){ + ) { canvas.width = mask_img.width; canvas.height = mask_img.height; } @@ -28,10 +28,10 @@ const animate = () => { const x_interval_ms = 19000; const y_interval_ms = 7000; const now = performance.now(); - if(!( + if (!( mask_img.complete && mask_img.naturalWidth > 1 && clouds_img.complete && clouds_img.naturalWidth > 1 - )){ + )) { return; } ctx.drawImage( @@ -41,7 +41,7 @@ const animate = () => { clouds_width, clouds_height ); - if(something_img.complete && something_img.naturalWidth > 1){ + if (something_img.complete && something_img.naturalWidth > 1) { let t = now / 5000; ctx.globalAlpha = 0.3 + Math.max(0, Math.sin(-t) * 1); ctx.drawImage( diff --git a/localization/parse-rc-file.js b/localization/parse-rc-file.js index 548644e..9d12321 100644 --- a/localization/parse-rc-file.js +++ b/localization/parse-rc-file.js @@ -1,8 +1,7 @@ // Based on: https://github.com/evernote/serge/blob/master/lib/Serge/Engine/Plugin/parse_rc.pm -module.exports = -function parse_rc_file(rc_file_text, callback, lang) { +module.exports = function parse_rc_file(rc_file_text, callback, lang) { // if (!callback) { // throw new TypeError('callback not specified'); // } @@ -81,9 +80,9 @@ function parse_rc_file(rc_file_text, callback, lang) { } // STRINGTABLE BEGIN...END block contents - // } else if (stringtable && block_level) { + // } else if (stringtable && block_level) { // actually just do any time, find any strings - }{ + } { // let match = line.match(/^[\t ]*(\w+)[\t ]+(L?"([^"]*?("")*)*?")/); let match = line.match(/(L?"(.*)")/); if (match) { // test for one-line string definitions diff --git a/localization/preprocess.js b/localization/preprocess.js index d0a5442..b978515 100644 --- a/localization/preprocess.js +++ b/localization/preprocess.js @@ -3,8 +3,8 @@ const glob = require("glob"); const parse_rc_file = require("./parse-rc-file"); const base_lang = "en"; -const available_langs = fs.readdirSync(__dirname).filter((dir)=> dir.match(/^\w+(-\w+)?$/)); -const target_langs = available_langs.filter((lang)=> lang !== base_lang); +const available_langs = fs.readdirSync(__dirname).filter((dir) => dir.match(/^\w+(-\w+)?$/)); +const target_langs = available_langs.filter((lang) => lang !== base_lang); console.log("Target languages:", target_langs); @@ -27,11 +27,11 @@ function remove_hotkey(text) { } const remove_ellipsis = str => str.replace("...", ""); -const only_unique = (value, index, self)=> self.indexOf(value) === index; +const only_unique = (value, index, self) => self.indexOf(value) === index; -const get_strings = (lang)=> { +const get_strings = (lang) => { return glob.sync(`${__dirname}/${lang}/**/*.rc`).map( - (rc_file)=> parse_rc_file(fs.readFileSync(rc_file, "utf16le").replace(/\ufeff/g, "")) + (rc_file) => parse_rc_file(fs.readFileSync(rc_file, "utf16le").replace(/\ufeff/g, "")) ).flat(); }; @@ -39,11 +39,11 @@ const base_strings = get_strings(base_lang); for (const target_lang of target_langs) { const target_strings = get_strings(target_lang); const localizations = {}; - const add_localization = (base_string, target_string, fudgedness)=> { + const add_localization = (base_string, target_string, fudgedness) => { localizations[base_string] = localizations[base_string] || []; - localizations[base_string].push({target_string, fudgedness}); + localizations[base_string].push({ target_string, fudgedness }); }; - const add_localizations = (base_strings, target_strings)=> { + const add_localizations = (base_strings, target_strings) => { for (let i = 0; i < target_strings.length; i++) { const base_string = base_strings[i]; const target_string = target_strings[i]; @@ -71,8 +71,8 @@ for (const target_lang of target_langs) { for (const base_string in localizations) { const options = localizations[base_string]; - options.sort((a, b)=> a.fudgedness - b.fudgedness); - const unique_strings = options.map(({target_string})=> target_string).filter(only_unique); + options.sort((a, b) => a.fudgedness - b.fudgedness); + const unique_strings = options.map(({ target_string }) => target_string).filter(only_unique); if (unique_strings.length > 1) { console.warn(`Collision for "${base_string}": ${JSON.stringify(unique_strings, null, "\t")}`); } diff --git a/src/OnCanvasSelection.js b/src/OnCanvasSelection.js index 0b99ca7..e8043c6 100644 --- a/src/OnCanvasSelection.js +++ b/src/OnCanvasSelection.js @@ -153,9 +153,9 @@ class OnCanvasSelection extends OnCanvasObject { // and should end up as the cut out image data for the selection // canvasImageData is initially the portion of image data on the canvas, // and should end up as... the portion of image data on the canvas that it should end up as. - // @TODO: could simplify by making the later (shared) condition just if(colored_cutout){} + // @TODO: could simplify by making the later (shared) condition just if (colored_cutout) // but might change how it works anyways so whatever - // if(!transparency){ // now if !transparency or if tool_transparent_mode + // if (!transparency) { // now if !transparency or if tool_transparent_mode // this is mainly in order to support patterns as the background color // NOTE: must come before cutout canvas is modified const colored_cutout = make_canvas(cutout); diff --git a/src/image-manipulation.js b/src/image-manipulation.js index 4f663b0..b9b6397 100644 --- a/src/image-manipulation.js +++ b/src/image-manipulation.js @@ -895,7 +895,7 @@ function draw_line(ctx, x1, y1, x2, y2, stroke_size) { draw_line_without_pattern_support(op_ctx_2d, x1, y1, x2, y2, stroke_size); }); // also works: - // draw_line_strip(ctx, [{x: x1, y: y1}, {x: x2, y: y2}]); + // draw_line_strip(ctx, [{ x: x1, y: y1 }, { x: x2, y: y2 }]); } let grid_pattern; diff --git a/src/sessions.js b/src/sessions.js index 571bb5c..d511707 100644 --- a/src/sessions.js +++ b/src/sessions.js @@ -445,26 +445,25 @@ // const label = synthetic ? "(synthetic)" : "(normal)"; // window.console && console.debug && console.debug(e.type, label); }; - + $canvas_area.on("pointerdown.session-hook", "*", (e, synthetic) => { debug_event(e, synthetic); - if(synthetic){ return; } + if (synthetic) { return; } - pointer_operations = [e]; - const pointermove = (e, synthetic) => { - debug_event(e, synthetic); - if(synthetic){ return; } - - pointer_operations.push(e); - }; - $G.on("pointermove.session-hook", pointermove); - $G.one("pointerup.session-hook", (e, synthetic) => { - debug_event(e, synthetic); - if(synthetic){ return; } - - $G.off("pointermove.session-hook", pointermove); - }); - } + pointer_operations = [e]; + const pointermove = (e, synthetic) => { + debug_event(e, synthetic); + if (synthetic) { return; } + + pointer_operations.push(e); + }; + $G.on("pointermove.session-hook", pointermove); + $G.one("pointerup.session-hook", (e, synthetic) => { + debug_event(e, synthetic); + if (synthetic) { return; } + + $G.off("pointermove.session-hook", pointermove); + }); }); */ } diff --git a/src/tool-options.js b/src/tool-options.js index 9dc6a60..4530d93 100644 --- a/src/tool-options.js +++ b/src/tool-options.js @@ -31,7 +31,7 @@ const ChooserCanvas = ( ); // eslint-disable-next-line no-empty } catch (error) { } - // if(invert){ + // if (invert) { // invert_rgb(c.ctx); // can fail due to tainted canvas if running from file: protocol // } c.style.filter = invert ? "invert()" : ""; diff --git a/src/tools.js b/src/tools.js index 22dad79..5343ae5 100644 --- a/src/tools.js +++ b/src/tools.js @@ -573,8 +573,8 @@ } // for debug: fill rect - // for(let x=0, x_limit=id_dest.width; x