Skip to content

Commit

Permalink
bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Jan 24, 2024
1 parent 05a9c0b commit f5bab55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/components/KeyboardHooks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@
function onKeyDown(e: any) {
const tagName = e.target.tagName.toLowerCase();
const tagType = e.target.type;
if (tagName === "input") {
const isUIElement =
tagType === "number" || tagType === "range" || tagType === "text";
if (isUIElement) {
return;
}
}
// block code mirror editing
if (e.target.getAttribute("class").includes("cm-content")) {
return;
}
if (tagName === "textarea") {
return;
}
Expand Down
6 changes: 4 additions & 2 deletions src/content-modules/contextual-tools/Rotate.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,24 @@
let localColors = memorizedColors;
let centerChannels = [0, 0, 0];
if (rotationPoint === "avg") {
const clrs = focusedColors.map((x) => localColors[x]);
// @ts-ignore
let center = avgColors(clrs, colorSpace);
centerChannels = center.toChannels();
} else if (rotationPoint === "zero") {
centerChannels = [0, 0, 0];
} else {
} else if (localColors[rotationPoint]) {
centerChannels = localColors[rotationPoint].toChannels();
} else {
centerChannels = [0, 0, 0];
}
const rotated = Object.fromEntries(
focusedColors
.map((x) => localColors[x])
.map((localColor) => {
console.log(localColor);
const color = Color.toColorSpace(localColor, colorSpace);
const channels = color.toChannels();
// https://math.stackexchange.com/questions/4354438/how-to-rotate-a-point-on-a-cartesian-plane-around-something-other-than-the-origi
Expand Down

0 comments on commit f5bab55

Please sign in to comment.