mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Sync panel props to editing element (#470)
* ensure panel props are sync to editing elem * ensure we don't create empty-text elements (fixes #468) * remove dead code Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
This commit is contained in:
parent
ff7a340d2f
commit
2340dddaad
7 changed files with 159 additions and 100 deletions
|
@ -5,7 +5,7 @@ export {
|
|||
deleteSelectedElements,
|
||||
someElementIsSelected,
|
||||
getElementsWithinSelection,
|
||||
getSelectedAttribute
|
||||
getCommonAttributeOfSelectedElements
|
||||
} from "./selection";
|
||||
export {
|
||||
exportCanvas,
|
||||
|
|
|
@ -56,7 +56,11 @@ export function getSelectedIndices(elements: readonly ExcalidrawElement[]) {
|
|||
export const someElementIsSelected = (elements: readonly ExcalidrawElement[]) =>
|
||||
elements.some(element => element.isSelected);
|
||||
|
||||
export function getSelectedAttribute<T>(
|
||||
/**
|
||||
* Returns common attribute (picked by `getAttribute` callback) of selected
|
||||
* elements. If elements don't share the same value, returns `null`.
|
||||
*/
|
||||
export function getCommonAttributeOfSelectedElements<T>(
|
||||
elements: readonly ExcalidrawElement[],
|
||||
getAttribute: (element: ExcalidrawElement) => T
|
||||
): T | null {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue