fix: Unify binding update options for updateBoundElements() (#8832)

Fix insonsistent naming for option newSize/oldSize for updateBoundElements()
This commit is contained in:
Márk Tolmács
2024-11-20 11:46:45 +01:00
committed by GitHub
parent 0927431d0d
commit 2db5bbcb29
8 changed files with 17 additions and 22 deletions

View File

@@ -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)) {

View File

@@ -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) {