MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / validateMouse

Function validateMouse

scripts/magnify_image.js:327–336  ·  view source on GitHub ↗
(x, y)

Source from the content-addressed store, hash-verified

325}
326
327function validateMouse(x, y) {
328 if (x == null || y == null) {
329 let mouse = getMousePos();
330 return {
331 x: mouse.x ?? x ?? 0,
332 y: mouse.y ?? y ?? 0,
333 };
334 }
335 return { x, y };
336}
337
338function magnifyImage(x, y) {
339 let mouse = validateMouse(x, y);

Callers 4

magnifyImageFunction · 0.85
getImagesAtPosFunction · 0.85
chooseImgFunction · 0.85
createPreviewFunction · 0.85

Calls 1

getMousePosFunction · 0.70

Tested by

no test coverage detected