Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–9 unchanged (9 lines)
10import type {
11 ElementsMap,
12 ExcalidrawElement,
13 NonDeletedSceneElementsMap,
14} from "../../element/types";
15import type Scene from "../../scene/Scene";
16import type { AppState, Point } from "../../types";
17import DragInput from "./DragInput";
18import type { DragInputCallbackType } from "./DragInput";
19import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
20import { getElementsInAtomicUnit, resizeElement } from "./utils";
21import type { AtomicUnit } from "./utils";
22import { MIN_WIDTH_OR_HEIGHT } from "../../constants";
23
24interface MultiDimensionProps {
25 property: "width" | "height";
26 elements: readonly ExcalidrawElement[];
27 elementsMap: NonDeletedSceneElementsMap;
28 atomicUnits: AtomicUnit[];
29 scene: Scene;
…lines 30–100 unchanged (71 lines)
101
102const resizeGroup = (
103 nextWidth: number,
104 nextHeight: number,
105 initialHeight: number,
106 aspectRatio: number,
107 anchor: Point,
108 property: MultiDimensionProps["property"],
109 latestElements: ExcalidrawElement[],
110 originalElements: ExcalidrawElement[],
111 elementsMap: NonDeletedSceneElementsMap,
112 originalElementsMap: ElementsMap,
113) => {
…lines 114–177 unchanged (64 lines)
178
179 resizeGroup(
180 nextWidth,
181 nextHeight,
182 initialHeight,
183 aspectRatio,
184 [x1, y1],
185 property,
186 latestElements,
187 originalElements,
188 elementsMap,
189 originalElementsMap,
190 );
…lines 191–282 unchanged (92 lines)
283
284 resizeGroup(
285 nextWidth,
286 nextHeight,
287 initialHeight,
288 aspectRatio,
289 [x1, y1],
290 property,
291 latestElements,
292 originalElements,
293 elementsMap,
294 originalElementsMap,
295 );
…lines 296–395 unchanged (100 lines)

After

…lines 1–9 unchanged (9 lines)
10import type {
11 ElementsMap,
12 ExcalidrawElement,
13 NonDeletedSceneElementsMap,
14} from "../../element/types";
15import type Scene from "../../scene/Scene";
16import type { AppState } from "../../types";
17import DragInput from "./DragInput";
18import type { DragInputCallbackType } from "./DragInput";
19import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
20import { getElementsInAtomicUnit, resizeElement } from "./utils";
21import type { AtomicUnit } from "./utils";
22import { MIN_WIDTH_OR_HEIGHT } from "../../constants";
23import { point, type GlobalPoint } from "../../../math";
24
25interface MultiDimensionProps {
26 property: "width" | "height";
27 elements: readonly ExcalidrawElement[];
28 elementsMap: NonDeletedSceneElementsMap;
29 atomicUnits: AtomicUnit[];
…lines 30–101 unchanged (72 lines)
102
103const resizeGroup = (
104 nextWidth: number,
105 nextHeight: number,
106 initialHeight: number,
107 aspectRatio: number,
108 anchor: GlobalPoint,
109 property: MultiDimensionProps["property"],
110 latestElements: ExcalidrawElement[],
111 originalElements: ExcalidrawElement[],
112 elementsMap: NonDeletedSceneElementsMap,
113 originalElementsMap: ElementsMap,
114) => {
…lines 115–178 unchanged (64 lines)
179
180 resizeGroup(
181 nextWidth,
182 nextHeight,
183 initialHeight,
184 aspectRatio,
185 point(x1, y1),
186 property,
187 latestElements,
188 originalElements,
189 elementsMap,
190 originalElementsMap,
191 );
…lines 192–283 unchanged (92 lines)
284
285 resizeGroup(
286 nextWidth,
287 nextHeight,
288 initialHeight,
289 aspectRatio,
290 point(x1, y1),
291 property,
292 latestElements,
293 originalElements,
294 elementsMap,
295 originalElementsMap,
296 );
…lines 297–396 unchanged (100 lines)

Before

program
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "useMemo"
} "}"
from "from"
string
" "\""
string_fragment "react"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getCommonBounds"
, ","
import_specifier
identifier "isTextElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "updateBoundElements"
} "}"
from "from"
string
" "\""
string_fragment "../../element/binding"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "mutateElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element/mutateElement"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "rescalePointsInElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element/resizeElements"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getBoundTextElement"
, ","
import_specifier
identifier "handleBindTextResize"
, ","
} "}"
from "from"
string
" "\""
string_fragment "../../element/textElement"
" "\""
; ";"
import_statement (+22 nodes collapsed)
import_statement
import "import"
type "type"
import_clause
identifier "Scene"
from "from"
string
" "\""
string_fragment "../../scene/Scene"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "AppState"
, ","
import_specifier
identifier "Point"
} "}"
from "from"
string
" "\""
string_fragment "../../types"
" "\""
; ";"
import_statement
import "import"
import_clause
identifier "DragInput"
from "from"
string
" "\""
string_fragment "./DragInput"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "DragInputCallbackType"
} "}"
from "from"
string
" "\""
string_fragment "./DragInput"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getAtomicUnits"
, ","
import_specifier
identifier "getStepSizedValue"
, ","
import_specifier
identifier "isPropertyEditable"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getElementsInAtomicUnit"
, ","
import_specifier
identifier "resizeElement"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "AtomicUnit"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "MIN_WIDTH_OR_HEIGHT"
} "}"
from "from"
string
" "\""
string_fragment "../../constants"
" "\""
; ";"
interface_declaration (+61 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "STEP_SIZE"
= "="
number "10"
; ";"
lexical_declaration (+185 nodes collapsed)
lexical_declaration (+275 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "resizeGroup"
= "="
arrow_function
formal_parameters
( "("
required_parameter
identifier "nextWidth"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "nextHeight"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "initialHeight"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "aspectRatio"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "anchor"
type_annotation
: ":"
type_identifier "Point"
, ","
required_parameter
identifier "property"
type_annotation
: ":"
lookup_type
type_identifier "MultiDimensionProps"
[ "["
literal_type
string
" "\""
string_fragment "property"
" "\""
] "]"
, ","
required_parameter
identifier "latestElements"
type_annotation
: ":"
array_type
type_identifier "ExcalidrawElement"
[ "["
] "]"
, ","
required_parameter
identifier "originalElements"
type_annotation
: ":"
array_type
type_identifier "ExcalidrawElement"
[ "["
] "]"
, ","
required_parameter
identifier "elementsMap"
type_annotation
: ":"
type_identifier "NonDeletedSceneElementsMap"
, ","
required_parameter
identifier "originalElementsMap"
type_annotation
: ":"
type_identifier "ElementsMap"
, ","
) ")"
=> "=>"
statement_block (+161 nodes collapsed)
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "handleDimensionChange"
type_annotation
: ":"
generic_type
type_identifier "DragInputCallbackType"
type_arguments
< "<"
lookup_type
type_identifier "MultiDimensionProps"
[ "["
literal_type
string
" "\""
string_fragment "property"
" "\""
] "]"
> ">"
= "="
arrow_function
formal_parameters (+23 nodes collapsed)
=> "=>"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsMap"
= "="
call_expression
member_expression
identifier "scene"
. "."
property_identifier "getNonDeletedElementsMap"
arguments
( "("
) ")"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "elements"
= "="
call_expression
member_expression
identifier "scene"
. "."
property_identifier "getNonDeletedElements"
arguments
( "("
) ")"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "atomicUnits"
= "="
call_expression
identifier "getAtomicUnits"
arguments
( "("
identifier "originalElements"
, ","
identifier "originalAppState"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "nextValue"
!== "!=="
undefined "undefined"
) ")"
statement_block
{ "{"
for_in_statement
for "for"
( "("
const "const"
identifier "atomicUnit"
of "of"
identifier "atomicUnits"
) ")"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsInUnit"
= "="
call_expression
identifier "getElementsInAtomicUnit"
arguments
( "("
identifier "atomicUnit"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
member_expression
identifier "elementsInUnit"
. "."
property_identifier "length"
> ">"
number "1"
) ")"
statement_block
{ "{"
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+21 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "initialWidth"
= "="
binary_expression
identifier "x2"
- "-"
identifier "x1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "initialHeight"
= "="
binary_expression
identifier "y2"
- "-"
identifier "y1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "aspectRatio"
= "="
binary_expression
identifier "initialWidth"
/ "/"
identifier "initialHeight"
; ";"
lexical_declaration (+39 nodes collapsed)
lexical_declaration (+39 nodes collapsed)
expression_statement
call_expression
identifier "resizeGroup"
arguments
( "("
identifier "nextWidth"
, ","
identifier "nextHeight"
, ","
identifier "initialHeight"
, ","
identifier "aspectRatio"
, ","
array
[ "["
identifier "x1"
, ","
identifier "y1"
] "]"
, ","
identifier "property"
, ","
identifier "latestElements"
, ","
identifier "originalElements"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
} "}"
else_clause (+288 nodes collapsed)
} "}"
expression_statement
call_expression
member_expression
identifier "scene"
. "."
property_identifier "triggerUpdate"
arguments
( "("
) ")"
; ";"
return_statement
return "return"
; ";"
} "}"
lexical_declaration
const "const"
variable_declarator
identifier "changeInWidth"
= "="
ternary_expression
binary_expression
identifier "property"
=== "==="
string
" "\""
string_fragment "width"
" "\""
? "?"
identifier "accumulatedChange"
: ":"
number "0"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "changeInHeight"
= "="
ternary_expression
binary_expression
identifier "property"
=== "==="
string
" "\""
string_fragment "height"
" "\""
? "?"
identifier "accumulatedChange"
: ":"
number "0"
; ";"
for_in_statement
for "for"
( "("
const "const"
identifier "atomicUnit"
of "of"
identifier "atomicUnits"
) ")"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsInUnit"
= "="
call_expression
identifier "getElementsInAtomicUnit"
arguments
( "("
identifier "atomicUnit"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
member_expression
identifier "elementsInUnit"
. "."
property_identifier "length"
> ">"
number "1"
) ")"
statement_block
{ "{"
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+21 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "initialWidth"
= "="
binary_expression
identifier "x2"
- "-"
identifier "x1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "initialHeight"
= "="
binary_expression
identifier "y2"
- "-"
identifier "y1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "aspectRatio"
= "="
binary_expression
identifier "initialWidth"
/ "/"
identifier "initialHeight"
; ";"
lexical_declaration
let "let"
variable_declarator
identifier "nextWidth"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
number "0"
, ","
binary_expression
identifier "initialWidth"
+ "+"
identifier "changeInWidth"
) ")"
; ";"
if_statement (+56 nodes collapsed)
lexical_declaration
let "let"
variable_declarator
identifier "nextHeight"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
number "0"
, ","
binary_expression
identifier "initialHeight"
+ "+"
identifier "changeInHeight"
) ")"
; ";"
if_statement (+56 nodes collapsed)
expression_statement
assignment_expression
identifier "nextWidth"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
identifier "MIN_WIDTH_OR_HEIGHT"
, ","
identifier "nextWidth"
) ")"
; ";"
expression_statement
assignment_expression
identifier "nextHeight"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
identifier "MIN_WIDTH_OR_HEIGHT"
, ","
identifier "nextHeight"
) ")"
; ";"
expression_statement
call_expression
identifier "resizeGroup"
arguments
( "("
identifier "nextWidth"
, ","
identifier "nextHeight"
, ","
identifier "initialHeight"
, ","
identifier "aspectRatio"
, ","
array
[ "["
identifier "x1"
, ","
identifier "y1"
] "]"
, ","
identifier "property"
, ","
identifier "latestElements"
, ","
identifier "originalElements"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
} "}"
else_clause (+270 nodes collapsed)
} "}"
expression_statement
call_expression
member_expression
identifier "scene"
. "."
property_identifier "triggerUpdate"
arguments
( "("
) ")"
; ";"
} "}"
; ";"
lexical_declaration (+386 nodes collapsed)
export_statement
export "export"
default "default"
identifier "MultiDimension"
; ";"

After

program
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "useMemo"
} "}"
from "from"
string
" "\""
string_fragment "react"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getCommonBounds"
, ","
import_specifier
identifier "isTextElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "updateBoundElements"
} "}"
from "from"
string
" "\""
string_fragment "../../element/binding"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "mutateElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element/mutateElement"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "rescalePointsInElement"
} "}"
from "from"
string
" "\""
string_fragment "../../element/resizeElements"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getBoundTextElement"
, ","
import_specifier
identifier "handleBindTextResize"
, ","
} "}"
from "from"
string
" "\""
string_fragment "../../element/textElement"
" "\""
; ";"
import_statement (+22 nodes collapsed)
import_statement
import "import"
type "type"
import_clause
identifier "Scene"
from "from"
string
" "\""
string_fragment "../../scene/Scene"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "AppState"
} "}"
from "from"
string
" "\""
string_fragment "../../types"
" "\""
; ";"
import_statement
import "import"
import_clause
identifier "DragInput"
from "from"
string
" "\""
string_fragment "./DragInput"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "DragInputCallbackType"
} "}"
from "from"
string
" "\""
string_fragment "./DragInput"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getAtomicUnits"
, ","
import_specifier
identifier "getStepSizedValue"
, ","
import_specifier
identifier "isPropertyEditable"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "getElementsInAtomicUnit"
, ","
import_specifier
identifier "resizeElement"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
type "type"
import_clause
named_imports
{ "{"
import_specifier
identifier "AtomicUnit"
} "}"
from "from"
string
" "\""
string_fragment "./utils"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "MIN_WIDTH_OR_HEIGHT"
} "}"
from "from"
string
" "\""
string_fragment "../../constants"
" "\""
; ";"
import_statement
import "import"
import_clause
named_imports
{ "{"
import_specifier
identifier "point"
, ","
import_specifier
type "type"
identifier "GlobalPoint"
} "}"
from "from"
string
" "\""
string_fragment "../../../math"
" "\""
; ";"
interface_declaration (+61 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "STEP_SIZE"
= "="
number "10"
; ";"
lexical_declaration (+185 nodes collapsed)
lexical_declaration (+275 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "resizeGroup"
= "="
arrow_function
formal_parameters
( "("
required_parameter
identifier "nextWidth"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "nextHeight"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "initialHeight"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "aspectRatio"
type_annotation
: ":"
predefined_type
number "number"
, ","
required_parameter
identifier "anchor"
type_annotation
: ":"
type_identifier "GlobalPoint"
, ","
required_parameter
identifier "property"
type_annotation
: ":"
lookup_type
type_identifier "MultiDimensionProps"
[ "["
literal_type
string
" "\""
string_fragment "property"
" "\""
] "]"
, ","
required_parameter
identifier "latestElements"
type_annotation
: ":"
array_type
type_identifier "ExcalidrawElement"
[ "["
] "]"
, ","
required_parameter
identifier "originalElements"
type_annotation
: ":"
array_type
type_identifier "ExcalidrawElement"
[ "["
] "]"
, ","
required_parameter
identifier "elementsMap"
type_annotation
: ":"
type_identifier "NonDeletedSceneElementsMap"
, ","
required_parameter
identifier "originalElementsMap"
type_annotation
: ":"
type_identifier "ElementsMap"
, ","
) ")"
=> "=>"
statement_block (+161 nodes collapsed)
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "handleDimensionChange"
type_annotation
: ":"
generic_type
type_identifier "DragInputCallbackType"
type_arguments
< "<"
lookup_type
type_identifier "MultiDimensionProps"
[ "["
literal_type
string
" "\""
string_fragment "property"
" "\""
] "]"
> ">"
= "="
arrow_function
formal_parameters (+23 nodes collapsed)
=> "=>"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsMap"
= "="
call_expression
member_expression
identifier "scene"
. "."
property_identifier "getNonDeletedElementsMap"
arguments
( "("
) ")"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "elements"
= "="
call_expression
member_expression
identifier "scene"
. "."
property_identifier "getNonDeletedElements"
arguments
( "("
) ")"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "atomicUnits"
= "="
call_expression
identifier "getAtomicUnits"
arguments
( "("
identifier "originalElements"
, ","
identifier "originalAppState"
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
identifier "nextValue"
!== "!=="
undefined "undefined"
) ")"
statement_block
{ "{"
for_in_statement
for "for"
( "("
const "const"
identifier "atomicUnit"
of "of"
identifier "atomicUnits"
) ")"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsInUnit"
= "="
call_expression
identifier "getElementsInAtomicUnit"
arguments
( "("
identifier "atomicUnit"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
member_expression
identifier "elementsInUnit"
. "."
property_identifier "length"
> ">"
number "1"
) ")"
statement_block
{ "{"
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+21 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "initialWidth"
= "="
binary_expression
identifier "x2"
- "-"
identifier "x1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "initialHeight"
= "="
binary_expression
identifier "y2"
- "-"
identifier "y1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "aspectRatio"
= "="
binary_expression
identifier "initialWidth"
/ "/"
identifier "initialHeight"
; ";"
lexical_declaration (+39 nodes collapsed)
lexical_declaration (+39 nodes collapsed)
expression_statement
call_expression
identifier "resizeGroup"
arguments
( "("
identifier "nextWidth"
, ","
identifier "nextHeight"
, ","
identifier "initialHeight"
, ","
identifier "aspectRatio"
, ","
call_expression
identifier "point"
arguments
( "("
identifier "x1"
, ","
identifier "y1"
) ")"
, ","
identifier "property"
, ","
identifier "latestElements"
, ","
identifier "originalElements"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
} "}"
else_clause (+288 nodes collapsed)
} "}"
expression_statement
call_expression
member_expression
identifier "scene"
. "."
property_identifier "triggerUpdate"
arguments
( "("
) ")"
; ";"
return_statement
return "return"
; ";"
} "}"
lexical_declaration
const "const"
variable_declarator
identifier "changeInWidth"
= "="
ternary_expression
binary_expression
identifier "property"
=== "==="
string
" "\""
string_fragment "width"
" "\""
? "?"
identifier "accumulatedChange"
: ":"
number "0"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "changeInHeight"
= "="
ternary_expression
binary_expression
identifier "property"
=== "==="
string
" "\""
string_fragment "height"
" "\""
? "?"
identifier "accumulatedChange"
: ":"
number "0"
; ";"
for_in_statement
for "for"
( "("
const "const"
identifier "atomicUnit"
of "of"
identifier "atomicUnits"
) ")"
statement_block
{ "{"
lexical_declaration
const "const"
variable_declarator
identifier "elementsInUnit"
= "="
call_expression
identifier "getElementsInAtomicUnit"
arguments
( "("
identifier "atomicUnit"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
if_statement
if "if"
parenthesized_expression
( "("
binary_expression
member_expression
identifier "elementsInUnit"
. "."
property_identifier "length"
> ">"
number "1"
) ")"
statement_block
{ "{"
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+27 nodes collapsed)
lexical_declaration (+21 nodes collapsed)
lexical_declaration
const "const"
variable_declarator
identifier "initialWidth"
= "="
binary_expression
identifier "x2"
- "-"
identifier "x1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "initialHeight"
= "="
binary_expression
identifier "y2"
- "-"
identifier "y1"
; ";"
lexical_declaration
const "const"
variable_declarator
identifier "aspectRatio"
= "="
binary_expression
identifier "initialWidth"
/ "/"
identifier "initialHeight"
; ";"
lexical_declaration
let "let"
variable_declarator
identifier "nextWidth"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
number "0"
, ","
binary_expression
identifier "initialWidth"
+ "+"
identifier "changeInWidth"
) ")"
; ";"
if_statement (+56 nodes collapsed)
lexical_declaration
let "let"
variable_declarator
identifier "nextHeight"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
number "0"
, ","
binary_expression
identifier "initialHeight"
+ "+"
identifier "changeInHeight"
) ")"
; ";"
if_statement (+56 nodes collapsed)
expression_statement
assignment_expression
identifier "nextWidth"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
identifier "MIN_WIDTH_OR_HEIGHT"
, ","
identifier "nextWidth"
) ")"
; ";"
expression_statement
assignment_expression
identifier "nextHeight"
= "="
call_expression
member_expression
identifier "Math"
. "."
property_identifier "max"
arguments
( "("
identifier "MIN_WIDTH_OR_HEIGHT"
, ","
identifier "nextHeight"
) ")"
; ";"
expression_statement
call_expression
identifier "resizeGroup"
arguments
( "("
identifier "nextWidth"
, ","
identifier "nextHeight"
, ","
identifier "initialHeight"
, ","
identifier "aspectRatio"
, ","
call_expression
identifier "point"
arguments
( "("
identifier "x1"
, ","
identifier "y1"
) ")"
, ","
identifier "property"
, ","
identifier "latestElements"
, ","
identifier "originalElements"
, ","
identifier "elementsMap"
, ","
identifier "originalElementsMap"
, ","
) ")"
; ";"
} "}"
else_clause (+270 nodes collapsed)
} "}"
expression_statement
call_expression
member_expression
identifier "scene"
. "."
property_identifier "triggerUpdate"
arguments
( "("
) ")"
; ";"
} "}"
; ";"
lexical_declaration (+386 nodes collapsed)
export_statement
export "export"
default "default"
identifier "MultiDimension"
; ";"