mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-05 09:48:44 +00:00
Make sure to run autocentering when the base image changes (#1023)
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user