mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: box select frame & children to allow resizing at the same time (#9031)
* box select frame & children * avoid selecting children twice to avoid double their moving * do not show ele stats if frame and children selected together * do not update frame membership if selected together * do not group frame and its children * comment and refactor code * hide align altogether * include frame children when selecting all * simplify --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
7028daa44a
commit
52eaf64591
12 changed files with 122 additions and 44 deletions
|
@ -31,6 +31,7 @@ import "./Stats.scss";
|
|||
import { isGridModeEnabled } from "../../snapping";
|
||||
import { getUncroppedWidthAndHeight } from "../../element/cropElement";
|
||||
import { round } from "../../../math";
|
||||
import { frameAndChildrenSelectedTogether } from "../../frame";
|
||||
|
||||
interface StatsProps {
|
||||
app: AppClassProperties;
|
||||
|
@ -170,6 +171,10 @@ export const StatsInner = memo(
|
|||
return getAtomicUnits(selectedElements, appState);
|
||||
}, [selectedElements, appState]);
|
||||
|
||||
const _frameAndChildrenSelectedTogether = useMemo(() => {
|
||||
return frameAndChildrenSelectedTogether(selectedElements);
|
||||
}, [selectedElements]);
|
||||
|
||||
return (
|
||||
<div className="exc-stats">
|
||||
<Island padding={3}>
|
||||
|
@ -226,7 +231,7 @@ export const StatsInner = memo(
|
|||
{renderCustomStats?.(elements, appState)}
|
||||
</Collapsible>
|
||||
|
||||
{selectedElements.length > 0 && (
|
||||
{!_frameAndChildrenSelectedTogether && selectedElements.length > 0 && (
|
||||
<div
|
||||
id="elementStats"
|
||||
style={{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue