mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: Unify binding update options for updateBoundElements()
(#8832)
Fix insonsistent naming for option newSize/oldSize for updateBoundElements()
This commit is contained in:
parent
0927431d0d
commit
2db5bbcb29
8 changed files with 17 additions and 22 deletions
|
@ -10237,7 +10237,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
croppingElement,
|
||||
this.scene.getNonDeletedElementsMap(),
|
||||
{
|
||||
oldSize: {
|
||||
newSize: {
|
||||
width: croppingElement.width,
|
||||
height: croppingElement.height,
|
||||
},
|
||||
|
|
|
@ -69,7 +69,6 @@ const resizeElementInGroup = (
|
|||
originalElementsMap: ElementsMap,
|
||||
) => {
|
||||
const updates = getResizedUpdates(anchorX, anchorY, scale, origElement);
|
||||
const { width: oldWidth, height: oldHeight } = latestElement;
|
||||
|
||||
mutateElement(latestElement, updates, false);
|
||||
const boundTextElement = getBoundTextElement(
|
||||
|
@ -79,7 +78,7 @@ const resizeElementInGroup = (
|
|||
if (boundTextElement) {
|
||||
const newFontSize = boundTextElement.fontSize * scale;
|
||||
updateBoundElements(latestElement, elementsMap, {
|
||||
oldSize: { width: oldWidth, height: oldHeight },
|
||||
newSize: { width: updates.width, height: updates.height },
|
||||
});
|
||||
const latestBoundTextElement = elementsMap.get(boundTextElement.id);
|
||||
if (latestBoundTextElement && isTextElement(latestBoundTextElement)) {
|
||||
|
|
|
@ -151,8 +151,6 @@ export const resizeElement = (
|
|||
nextHeight = Math.max(nextHeight, minHeight);
|
||||
}
|
||||
|
||||
const { width: oldWidth, height: oldHeight } = latestElement;
|
||||
|
||||
mutateElement(
|
||||
latestElement,
|
||||
{
|
||||
|
@ -201,7 +199,7 @@ export const resizeElement = (
|
|||
}
|
||||
|
||||
updateBoundElements(latestElement, elementsMap, {
|
||||
oldSize: { width: oldWidth, height: oldHeight },
|
||||
newSize: { width: nextWidth, height: nextHeight },
|
||||
});
|
||||
|
||||
if (boundTextElement && boundTextFont) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue