mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Only show correct settings (#565)
* Only show correct settings The logic to display which settings when nothing was selected was incorrect. This PR ensures that they are in sync. I also removed all the <hr /> which after the redesigned just looked like weird empty spaces * fix handling editing/text elements Co-authored-by: David Luzar <luzar.david@gmail.com>
This commit is contained in:
parent
2a87c7381b
commit
141b7409a2
2 changed files with 19 additions and 40 deletions
|
@ -2,28 +2,17 @@ import { ExcalidrawElement } from "../element/types";
|
|||
import { hitTest } from "../element/collision";
|
||||
import { getElementAbsoluteCoords } from "../element";
|
||||
|
||||
export const hasBackground = (elements: readonly ExcalidrawElement[]) =>
|
||||
elements.some(
|
||||
element =>
|
||||
element.isSelected &&
|
||||
(element.type === "rectangle" ||
|
||||
element.type === "ellipse" ||
|
||||
element.type === "diamond"),
|
||||
);
|
||||
export const hasBackground = (type: string) =>
|
||||
type === "rectangle" || type === "ellipse" || type === "diamond";
|
||||
|
||||
export const hasStroke = (elements: readonly ExcalidrawElement[]) =>
|
||||
elements.some(
|
||||
element =>
|
||||
element.isSelected &&
|
||||
(element.type === "rectangle" ||
|
||||
element.type === "ellipse" ||
|
||||
element.type === "diamond" ||
|
||||
element.type === "arrow" ||
|
||||
element.type === "line"),
|
||||
);
|
||||
export const hasStroke = (type: string) =>
|
||||
type === "rectangle" ||
|
||||
type === "ellipse" ||
|
||||
type === "diamond" ||
|
||||
type === "arrow" ||
|
||||
type === "line";
|
||||
|
||||
export const hasText = (elements: readonly ExcalidrawElement[]) =>
|
||||
elements.some(element => element.isSelected && element.type === "text");
|
||||
export const hasText = (type: string) => type === "text";
|
||||
|
||||
export function getElementAtPosition(
|
||||
elements: readonly ExcalidrawElement[],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue