mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add props.renderScrollbars
(#9399)
* Expose renderScrollbars to AppState * fix: scrollbar rendering should use al renderable elements * remove `appState.renderScrollbars` * clean unused --------- Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
This commit is contained in:
parent
b5d60973b7
commit
5fc13e4309
11 changed files with 53 additions and 16 deletions
|
@ -1218,3 +1218,18 @@ export const elementCenterPoint = (
|
|||
|
||||
return pointFrom<GlobalPoint>(centerXPoint, centerYPoint);
|
||||
};
|
||||
|
||||
/** hack for Array.isArray type guard not working with readonly value[] */
|
||||
export const isReadonlyArray = (value?: any): value is readonly any[] => {
|
||||
return Array.isArray(value);
|
||||
};
|
||||
|
||||
export const sizeOf = (
|
||||
value: readonly number[] | Readonly<Map<any, any>> | Record<any, any>,
|
||||
): number => {
|
||||
return isReadonlyArray(value)
|
||||
? value.length
|
||||
: value instanceof Map
|
||||
? value.size
|
||||
: Object.keys(value).length;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue