Make sure to run autocentering when the base image changes (#1023)

This commit is contained in:
Tanish Manku authored and GitHub committed 2026-01-31 01:22:52 -08:00
1 parent 9a9b9bd12d
commit c4298cc02b
1 file changed
+5 -1
@@ -568,6 +568,10 @@ const PageDraw = () => {
// Auto-fit canvas to screen on initial load
useEffect(() => {
if (!store.baseImageBitmap) {
return;
}
const autoFitCanvas = async () => {
let attempts = 0;
const maxAttempts = 20;
@@ -593,7 +597,7 @@ const PageDraw = () => {
autoFitCanvas();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [store.baseImageBitmap]);
// Display image selector on launch, otherwise hide it
// Also show loading state if info is set but image is loading