fix(editor): recalculate roundness type when switching shape types (#11473)
When converting between generic shapes, the roundness type was only recalculated when the target type was a diamond. Converting a diamond (which uses the proportional radius algorithm) back to a rectangle kept the proportional radius, so rectangles ended up rendering with overly round corners. --------- Signed-off-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: Maruthan G <maruthang4@gmail.com> Co-authored-by: Sivram <withsivram@gmail.com> Co-authored-by: Jai Kumar Dewani <jai.dewani.99@gmail.com> Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
@@ -19,8 +19,7 @@ import {
|
||||
newTextElement,
|
||||
} from "@excalidraw/element";
|
||||
|
||||
import { isLinearElementType } from "@excalidraw/element";
|
||||
import { getSelectedElements } from "@excalidraw/element";
|
||||
import { isUsingAdaptiveRadius, getSelectedElements } from "@excalidraw/element";
|
||||
import { selectGroupsForSelectedElements } from "@excalidraw/element";
|
||||
|
||||
import { FONT_SIZES } from "@excalidraw/common";
|
||||
@@ -267,9 +266,9 @@ export class API {
|
||||
: rest.roundness
|
||||
)
|
||||
? {
|
||||
type: isLinearElementType(type)
|
||||
? ROUNDNESS.PROPORTIONAL_RADIUS
|
||||
: ROUNDNESS.ADAPTIVE_RADIUS,
|
||||
type: isUsingAdaptiveRadius(type)
|
||||
? ROUNDNESS.ADAPTIVE_RADIUS
|
||||
: ROUNDNESS.PROPORTIONAL_RADIUS,
|
||||
}
|
||||
: null,
|
||||
roughness: rest.roughness ?? appState.currentItemRoughness,
|
||||
|
||||
Reference in New Issue
Block a user