Add a reset button

Probably overkill, but I kinda like it.
This commit is contained in:
2024-11-30 18:01:29 -05:00
parent 6c4d73f081
commit b7eed2297a
11 changed files with 64 additions and 41 deletions

View File

@ -14,8 +14,8 @@ export interface PainterProps {
export const PainterContext = createContext<PainterProps>(null);
interface CanvasProps {
width: number;
height: number;
width?: number;
height?: number;
children?: React.ReactNode;
}
@ -125,6 +125,8 @@ export default function Canvas({width, height, children}: CanvasProps) {
const [painter, setPainter] = useState<Iterator<ImageData>>(null);
useEffect(() => setAnimHolder({ painter }), [painter]);
width = width ?? 500;
height = height ?? 500;
return (
<>
<center>

View File

@ -20,4 +20,9 @@
.inputElement > p {
margin: 0
}
.inputReset {
display: flex;
float: right;
}

View File

@ -36,8 +36,8 @@ export const xform2Coefs = {
d: -0.031367, e: 0.031393, f: 0,
}
export const xform2CoefsPost = {
a: 1, b: 0, c: 0.241352,
d: 0, e: 1, f: 0.271521,
a: 1, b: 0, c: 0.24,
d: 0, e: 1, f: 0.27,
}
export const xform2Variations: VariationBlend = [
[1, linear],