Merge branch 'master' into make-elements-immutable

This commit is contained in:
Gasim Gasimzada 2020-01-09 13:03:20 +04:00
commit 88006ab426
7 changed files with 183 additions and 60 deletions

View file

@ -21,6 +21,9 @@ export const hasStroke = (elements: ExcalidrawElement[]) =>
element.type === "arrow")
);
export const hasText = (elements: ExcalidrawElement[]) =>
elements.some(element => element.isSelected && element.type === "text");
export function getElementAtPosition(
elements: ExcalidrawElement[],
x: number,

View file

@ -18,6 +18,7 @@ export {
hasBackground,
hasStroke,
getElementAtPosition,
getElementContainingPosition
getElementContainingPosition,
hasText
} from "./comparisons";
export { createScene } from "./createScene";

View file

@ -7,6 +7,11 @@ export type SceneState = {
viewBackgroundColor: string | null;
};
export type SceneScroll = {
scrollX: number;
scrollY: number;
};
export interface Scene {
elements: ExcalidrawTextElement[];
}