mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
test case + consistent text scaling
This commit is contained in:
parent
d783aaa236
commit
2ec50ca587
2 changed files with 125 additions and 5 deletions
|
@ -1503,11 +1503,15 @@ export const resizeMultipleElements = (
|
|||
}
|
||||
|
||||
if (isTextElement(orig)) {
|
||||
const metrics = measureFontSizeFromWidth(orig, elementsMap, width);
|
||||
if (!metrics) {
|
||||
return;
|
||||
if (!shouldMaintainAspectRatio) {
|
||||
const metrics = measureFontSizeFromWidth(orig, elementsMap, width);
|
||||
if (!metrics) {
|
||||
return;
|
||||
}
|
||||
update.fontSize = metrics.size;
|
||||
} else {
|
||||
update.fontSize = orig.fontSize;
|
||||
}
|
||||
update.fontSize = metrics.size;
|
||||
}
|
||||
|
||||
const boundTextElement = originalElementsMap.get(
|
||||
|
@ -1515,7 +1519,7 @@ export const resizeMultipleElements = (
|
|||
) as ExcalidrawTextElementWithContainer | undefined;
|
||||
|
||||
if (boundTextElement) {
|
||||
if (keepAspectRatio) {
|
||||
if (keepAspectRatio && !shouldMaintainAspectRatio) {
|
||||
const newFontSize = boundTextElement.fontSize * scale;
|
||||
if (newFontSize < MIN_FONT_SIZE) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue