mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
switch different types altogether
This commit is contained in:
parent
41a4dadaaf
commit
aa9139ad78
3 changed files with 53 additions and 38 deletions
|
@ -192,6 +192,10 @@ const Panel = ({
|
|||
let [x1, y2, cx, cy] = [0, 0, 0, 0];
|
||||
let rotatedBottomLeft = [0, 0];
|
||||
|
||||
const sameType = elements.every(
|
||||
(element) => element.type === elements[0].type,
|
||||
);
|
||||
|
||||
if (elements.length === 1) {
|
||||
[x1, , , y2, cx, cy] = getElementAbsoluteCoords(
|
||||
elements[0],
|
||||
|
@ -245,17 +249,18 @@ const Panel = ({
|
|||
>
|
||||
{SHAPES.map(([type, shortcut, icon]) => {
|
||||
const isSelected =
|
||||
type === elements[0].type ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
elements[0].elbowed &&
|
||||
type === "elbow") ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
elements[0].roundness &&
|
||||
type === "curve") ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
!elements[0].elbowed &&
|
||||
!elements[0].roundness &&
|
||||
type === "straight");
|
||||
sameType &&
|
||||
(type === elements[0].type ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
elements[0].elbowed &&
|
||||
type === "elbow") ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
elements[0].roundness &&
|
||||
type === "curve") ||
|
||||
(isArrowElement(elements[0]) &&
|
||||
!elements[0].elbowed &&
|
||||
!elements[0].roundness &&
|
||||
type === "straight"));
|
||||
|
||||
return (
|
||||
<ToolButton
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue