stickies: make pit/pack distance the same

pull/3606/head
Mime Čuvalo 2024-04-25 11:54:54 +01:00
rodzic a319ad9497
commit 8b7ae64e7b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: BA84499022AC984D
3 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -36,9 +36,9 @@ import {
import { getFontDefForExport } from '../shared/defaultStyleDefs'
import { startEditingShapeWithLabel } from '../../tools/SelectTool/selectHelpers'
import { ADJACENT_SHAPE_MARGIN } from '../../ui/constants'
import { useForceSolid } from '../shared/useForceSolid'
import {
ADJACENT_NOTE_MARGIN,
CLONE_HANDLE_MARGIN,
NOTE_CENTER_OFFSET,
NOTE_SIZE,
@ -402,7 +402,7 @@ function useNoteKeydownHandler(id: TLShapeId) {
const offsetLength =
NOTE_SIZE +
ADJACENT_NOTE_MARGIN +
ADJACENT_SHAPE_MARGIN +
// If we're growing down, we need to account for the current shape's growY
(isCmdEnter && !e.shiftKey ? shape.props.growY : 0)

Wyświetl plik

@ -12,3 +12,5 @@ export enum PORTRAIT_BREAKPOINT {
TABLET = 6,
DESKTOP = 7,
}
export const ADJACENT_SHAPE_MARGIN = 20

Wyświetl plik

@ -25,6 +25,7 @@ import { getEmbedInfo } from '../../utils/embeds/embeds'
import { fitFrameToContent, removeFrame } from '../../utils/frames/frames'
import { EditLinkDialog } from '../components/EditLinkDialog'
import { EmbedDialog } from '../components/EmbedDialog'
import { ADJACENT_SHAPE_MARGIN } from '../constants'
import { useMenuClipboardEvents } from '../hooks/useClipboardEvents'
import { useCopyAs } from '../hooks/useCopyAs'
import { useExportAs } from '../hooks/useExportAs'
@ -818,7 +819,7 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) {
trackEvent('pack-shapes', { source })
editor.mark('pack')
const selectedShapeIds = editor.getSelectedShapeIds()
editor.packShapes(selectedShapeIds, 16)
editor.packShapes(selectedShapeIds, ADJACENT_SHAPE_MARGIN)
kickoutOccludedShapes(editor, selectedShapeIds)
},
},