fix: scale selector
This commit is contained in:
parent
22b58e68ec
commit
c578e4b640
@ -1,4 +1,10 @@
|
|||||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
import React, {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
import type { ActionManager } from "../actions/manager";
|
import type { ActionManager } from "../actions/manager";
|
||||||
@ -106,12 +112,16 @@ const ImageExportModal = ({
|
|||||||
const previewRef = useRef<HTMLDivElement>(null);
|
const previewRef = useRef<HTMLDivElement>(null);
|
||||||
const [renderError, setRenderError] = useState<Error | null>(null);
|
const [renderError, setRenderError] = useState<Error | null>(null);
|
||||||
|
|
||||||
const exportedElements = exportSelected
|
const exportedElements = useMemo(
|
||||||
|
() =>
|
||||||
|
exportSelected
|
||||||
? getSelectedElements(elements, appState, {
|
? getSelectedElements(elements, appState, {
|
||||||
includeBoundTextElement: true,
|
includeBoundTextElement: true,
|
||||||
includeElementsInFrames: true,
|
includeElementsInFrames: true,
|
||||||
})
|
})
|
||||||
: elements;
|
: elements,
|
||||||
|
[exportSelected, elements],
|
||||||
|
);
|
||||||
|
|
||||||
const updateAllScales = useCallback(
|
const updateAllScales = useCallback(
|
||||||
(scale: number) => {
|
(scale: number) => {
|
||||||
@ -168,9 +178,10 @@ const ImageExportModal = ({
|
|||||||
}, [
|
}, [
|
||||||
exportBackgroundImage,
|
exportBackgroundImage,
|
||||||
exportWithBackground,
|
exportWithBackground,
|
||||||
exportedElements,
|
|
||||||
exportBaseScale,
|
exportBaseScale,
|
||||||
updateAllScales,
|
updateAllScales,
|
||||||
|
exportedElements,
|
||||||
|
exportSelected,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user