fix: the resolution fields in Rendering no longer reset each other (#73)

The `getSize` method did not cause the React component to observe the
result, as you would get with `useState`. This caused the component to
never receive the new values when after changing them, and upon setting
the other value (whichever comes second), it would re-set the first
value to its original setting. This is the quickest possible fix.
This commit is contained in:
Ross Esmond
2022-10-11 03:20:21 -05:00
committed by GitHub
parent f808a562b1
commit ddabec549b

View File

@@ -73,6 +73,7 @@ export function Rendering() {
value={width}
onChange={event => {
const value = parseInt((event.target as HTMLInputElement).value);
const {height} = player.project.getSize();
player.project.setSize(value, height);
}}
/>
@@ -83,6 +84,7 @@ export function Rendering() {
value={height}
onChange={event => {
const value = parseInt((event.target as HTMLInputElement).value);
const {width} = player.project.getSize();
player.project.setSize(width, value);
}}
/>