Fix flickering selection

This commit is contained in:
Mark Tolmacs 2025-03-15 14:02:39 +01:00
parent 02aeb5ab63
commit cf75f6bfe0
2 changed files with 2 additions and 2 deletions

View file

@ -2088,7 +2088,7 @@ class App extends React.Component<AppProps, AppState> {
swapPreviewOnAlt: true,
colorPickerType:
type === "stroke" ? "elementStroke" : "elementBackground",
onSelect: (color, event) => {
onSelect: (color: string, event: KeyboardEvent) => {
const shouldUpdateStrokeColor =
(type === "background" && event.altKey) ||
(type === "stroke" && !event.altKey);

View file

@ -1089,7 +1089,7 @@ const _renderInteractiveScene = ({
const dashedLinePadding =
(DEFAULT_TRANSFORM_HANDLE_SPACING * 2) / appState.zoom.value;
context.fillStyle = oc.white;
const [x1, y1, x2, y2] = getCommonBounds(selectedElements);
const [x1, y1, x2, y2] = getCommonBounds(selectedElements, elementsMap);
const initialLineDash = context.getLineDash();
context.setLineDash([2 / appState.zoom.value]);
const lineWidth = context.lineWidth;