fix: scrollbar rendering should use al renderable elements

This commit is contained in:
dwelle 2025-04-19 17:57:59 +02:00
parent c1be250493
commit ede053932e
9 changed files with 160 additions and 14 deletions

View file

@ -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;
};

View file

@ -1,6 +1,11 @@
import rough from "roughjs/bin/rough";
import { rescalePoints, arrayToMap, invariant } from "@excalidraw/common";
import {
rescalePoints,
arrayToMap,
invariant,
sizeOf,
} from "@excalidraw/common";
import {
degreesToRadians,
@ -57,6 +62,7 @@ import type {
ElementsMap,
ExcalidrawRectanguloidElement,
ExcalidrawEllipseElement,
ElementsMapOrArray,
} from "./types";
import type { Drawable, Op } from "roughjs/bin/core";
import type { Point as RoughPoint } from "roughjs/bin/geometry";
@ -938,10 +944,10 @@ export const getElementBounds = (
};
export const getCommonBounds = (
elements: readonly ExcalidrawElement[],
elements: ElementsMapOrArray,
elementsMap?: ElementsMap,
): Bounds => {
if (!elements.length) {
if (!sizeOf(elements)) {
return [0, 0, 0, 0];
}

View file

@ -1182,7 +1182,7 @@ const _renderInteractiveScene = ({
let scrollBars;
if (renderConfig.renderScrollbars) {
scrollBars = getScrollBars(
visibleElements,
elementsMap,
normalizedWidth,
normalizedHeight,
appState,

View file

@ -6,6 +6,7 @@ import {
toBrandedType,
isDevEnv,
isTestEnv,
isReadonlyArray,
} from "@excalidraw/common";
import { isNonDeletedElement } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
@ -292,11 +293,9 @@ class Scene {
}
replaceAllElements(nextElements: ElementsMapOrArray) {
const _nextElements =
// ts doesn't like `Array.isArray` of `instanceof Map`
nextElements instanceof Array
? nextElements
: Array.from(nextElements.values());
const _nextElements = isReadonlyArray(nextElements)
? nextElements
: Array.from(nextElements.values());
const nextFrameLikes: ExcalidrawFrameLikeElement[] = [];
validateIndicesThrottled(_nextElements);

View file

@ -2,24 +2,22 @@ import { getGlobalCSSVariable } from "@excalidraw/common";
import { getCommonBounds } from "@excalidraw/element/bounds";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { getLanguage } from "../i18n";
import type { InteractiveCanvasAppState } from "../types";
import type { ScrollBars } from "./types";
import type { RenderableElementsMap, ScrollBars } from "./types";
export const SCROLLBAR_MARGIN = 4;
export const SCROLLBAR_WIDTH = 6;
export const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
export const getScrollBars = (
elements: readonly ExcalidrawElement[],
elements: RenderableElementsMap,
viewportWidth: number,
viewportHeight: number,
appState: InteractiveCanvasAppState,
): ScrollBars => {
if (!elements.length) {
if (!elements.size) {
return {
horizontal: null,
vertical: null,

View file

@ -957,6 +957,7 @@ exports[`contextMenu element > right-clicking on a group should select whole gro
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1164,6 +1165,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1384,6 +1386,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1719,6 +1722,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2054,6 +2058,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2274,6 +2279,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2518,6 +2524,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2825,6 +2832,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"previousSelectedElementIds": {
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3196,6 +3204,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3675,6 +3684,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4002,6 +4012,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4331,6 +4342,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"previousSelectedElementIds": {
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5612,6 +5624,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6834,6 +6847,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7770,6 +7784,7 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8774,6 +8789,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9766,6 +9782,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,

View file

@ -81,6 +81,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"previousSelectedElementIds": {
"id172": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -681,6 +682,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"previousSelectedElementIds": {
"id167": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1190,6 +1192,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1562,6 +1565,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1935,6 +1939,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2203,6 +2208,7 @@ exports[`history > multiplayer undo/redo > conflicts in arrows and their bindabl
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2646,6 +2652,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2949,6 +2956,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3237,6 +3245,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3535,6 +3544,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3825,6 +3835,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4064,6 +4075,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4327,6 +4339,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4604,6 +4617,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4839,6 +4853,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5074,6 +5089,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5307,6 +5323,7 @@ exports[`history > multiplayer undo/redo > conflicts in bound text elements and
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5540,6 +5557,7 @@ exports[`history > multiplayer undo/redo > conflicts in frames and their childre
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5802,6 +5820,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"previousSelectedElementIds": {
"id116": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6137,6 +6156,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"previousSelectedElementIds": {
"id103": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6566,6 +6586,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"previousSelectedElementIds": {
"id106": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6949,6 +6970,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7269,6 +7291,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7571,6 +7594,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7804,6 +7828,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8163,6 +8188,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8525,6 +8551,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"id133": true,
"id134": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8930,6 +8957,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9221,6 +9249,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9490,6 +9519,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9758,6 +9788,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9996,6 +10027,7 @@ exports[`history > multiplayer undo/redo > should override remotely added groups
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10298,6 +10330,7 @@ exports[`history > multiplayer undo/redo > should override remotely added points
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10642,6 +10675,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10884,6 +10918,7 @@ exports[`history > multiplayer undo/redo > should redraw arrows on undo > [end o
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11334,6 +11369,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11592,6 +11628,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11835,6 +11872,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -12080,6 +12118,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -12488,6 +12527,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on s
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": -50,
"scrollY": -50,
@ -12736,6 +12776,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -12981,6 +13022,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13228,6 +13270,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"previousSelectedElementIds": {
"id15": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13477,6 +13520,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13816,6 +13860,7 @@ exports[`history > singleplayer undo/redo > should not collapse when applying co
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13989,6 +14034,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14284,6 +14330,7 @@ exports[`history > singleplayer undo/redo > should not end up with history entry
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14554,6 +14601,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"previousSelectedElementIds": {
"id11": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14834,6 +14882,7 @@ exports[`history > singleplayer undo/redo > should support appstate name or view
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14998,6 +15047,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"previousSelectedElementIds": {
"id56": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -15696,6 +15746,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"previousSelectedElementIds": {
"id50": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -16316,6 +16367,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"previousSelectedElementIds": {
"id62": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -16934,6 +16986,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -17647,6 +17700,7 @@ exports[`history > singleplayer undo/redo > should support bidirectional binding
"previousSelectedElementIds": {
"id75": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -18395,6 +18449,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"previousSelectedElementIds": {
"id45": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -18873,6 +18928,7 @@ exports[`history > singleplayer undo/redo > should support duplication of groups
"previousSelectedElementIds": {
"id36": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -19399,6 +19455,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"previousSelectedElementIds": {
"id23": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -19859,6 +19916,7 @@ exports[`history > singleplayer undo/redo > should support linear element creati
"previousSelectedElementIds": {
"id27": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,

View file

@ -84,6 +84,7 @@ exports[`given element A and group of elements B and given both are selected whe
"id1": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -500,6 +501,7 @@ exports[`given element A and group of elements B and given both are selected whe
"id1": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -903,6 +905,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1449,6 +1452,7 @@ exports[`regression tests > Drags selected element when hitting only bounding bo
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -1656,6 +1660,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2032,6 +2037,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2269,6 +2275,7 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = `
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2452,6 +2459,7 @@ exports[`regression tests > can drag element that covers another element, while
"previousSelectedElementIds": {
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -2771,6 +2779,7 @@ exports[`regression tests > change the properties of a shape > [end of test] app
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3020,6 +3029,7 @@ exports[`regression tests > click on an element and drag it > [dragged] appState
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3264,6 +3274,7 @@ exports[`regression tests > click on an element and drag it > [end of test] appS
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3495,6 +3506,7 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`]
"previousSelectedElementIds": {
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -3752,6 +3764,7 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat
"previousSelectedElementIds": {
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4062,6 +4075,7 @@ exports[`regression tests > deleting last but one element in editing group shoul
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4488,6 +4502,7 @@ exports[`regression tests > deselects group of selected elements on pointer down
"id0": true,
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -4772,6 +4787,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w
"id0": true,
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5025,6 +5041,7 @@ exports[`regression tests > deselects selected element on pointer down when poin
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5236,6 +5253,7 @@ exports[`regression tests > deselects selected element, on pointer up, when clic
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5434,6 +5452,7 @@ exports[`regression tests > double click to edit a group > [end of test] appStat
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -5820,6 +5839,7 @@ exports[`regression tests > drags selected elements from point inside common bou
"id0": true,
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6108,6 +6128,7 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1`
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -6920,6 +6941,7 @@ exports[`regression tests > given a group of selected elements with an element t
"id0": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7250,6 +7272,7 @@ exports[`regression tests > given a selected element A and a not selected elemen
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7527,6 +7550,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7762,6 +7786,7 @@ exports[`regression tests > given selected element A with lower z-index than uns
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -7998,6 +8023,7 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8179,6 +8205,7 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8360,6 +8387,7 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8541,6 +8569,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1`
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8765,6 +8794,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`]
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -8988,6 +9018,7 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9183,6 +9214,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1`
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9407,6 +9439,7 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9588,6 +9621,7 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`]
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9811,6 +9845,7 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -9992,6 +10027,7 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10187,6 +10223,7 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10372,6 +10409,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta
"id1": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -10879,6 +10917,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11155,6 +11194,7 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = `
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": "-6.25000",
"scrollY": 0,
@ -11284,6 +11324,7 @@ exports[`regression tests > shift click on selected element should deselect it o
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11485,6 +11526,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test
"id0": true,
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -11798,6 +11840,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes
"id1": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -12212,6 +12255,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh
"id5": true,
"id6": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -12824,6 +12868,7 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 60,
"scrollY": 60,
@ -12953,6 +12998,7 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`]
"previousSelectedElementIds": {
"id0": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13539,6 +13585,7 @@ exports[`regression tests > switches from group of selected elements to another
"id1": true,
"id2": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -13877,6 +13924,7 @@ exports[`regression tests > switches selected element on pointer down > [end of
"previousSelectedElementIds": {
"id1": true,
},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14141,6 +14189,7 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`]
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 20,
"scrollY": "-18.53553",
@ -14268,6 +14317,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14648,6 +14698,7 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,
@ -14778,6 +14829,7 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = `
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,

View file

@ -81,6 +81,7 @@ exports[`exportToSvg > with default arguments 1`] = `
"penMode": false,
"pendingImageElementId": null,
"previousSelectedElementIds": {},
"renderScrollbars": false,
"resizingElement": null,
"scrollX": 0,
"scrollY": 0,