Bounds guard on zoom.
This commit is contained in:
parent
d7dcbbd318
commit
1f5a377194
@ -23,8 +23,8 @@ const Sidebar = (props) => {
|
|||||||
if (pix === undefined) { return <p key={md.name}>Loading...</p>; }
|
if (pix === undefined) { return <p key={md.name}>Loading...</p>; }
|
||||||
let max = binaryMax[md.name];
|
let max = binaryMax[md.name];
|
||||||
let [w, h] = md.size;
|
let [w, h] = md.size;
|
||||||
let xOff = mouseX; // Math.min(w, Math.max(0, Math.round(x*w)));
|
let xOff = Math.min(mouseX,w-1); // Math.min(w, Math.max(0, Math.round(x*w)));
|
||||||
let yOff = mouseY; // Math.min(h, Math.max(0, Math.round(y*h)));
|
let yOff = Math.min(mouseY,h-1); // Math.min(h, Math.max(0, Math.round(y*h)));
|
||||||
let v = pix[xOff+yOff*w];
|
let v = pix[xOff+yOff*w];
|
||||||
let color = "#fff";
|
let color = "#fff";
|
||||||
let rgb = "";
|
let rgb = "";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user