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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 17 additions and 22 deletions

View file

@ -10237,7 +10237,7 @@ class App extends React.Component<AppProps, AppState> {
croppingElement,
this.scene.getNonDeletedElementsMap(),
{
oldSize: {
newSize: {
width: croppingElement.width,
height: croppingElement.height,
},

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