refactor(background): set default gap to 20
Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -6,8 +6,8 @@ import { DotPattern, LinePattern } from './patterns'
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
id,
|
id,
|
||||||
variant = 'dots' as BackgroundVariant,
|
variant = BackgroundVariant.Dots,
|
||||||
gap = 10,
|
gap = 20,
|
||||||
size = 1,
|
size = 1,
|
||||||
lineWidth = 1,
|
lineWidth = 1,
|
||||||
height = 100,
|
height = 100,
|
||||||
@@ -26,10 +26,10 @@ const defaultColors: Record<BackgroundVariant, string> = {
|
|||||||
|
|
||||||
const { id: vueFlowId, viewport } = useVueFlow()
|
const { id: vueFlowId, viewport } = useVueFlow()
|
||||||
|
|
||||||
const gapXY = computed(() => (Array.isArray(gap) ? gap : [gap, gap]))
|
|
||||||
|
|
||||||
const background = computed(() => {
|
const background = computed(() => {
|
||||||
const scaledGap: [number, number] = [gapXY.value[0] * viewport.value.zoom || 1, gapXY.value[1] * viewport.value.zoom || 1]
|
const [gapX, gapY] = Array.isArray(gap) ? gap : [gap, gap]
|
||||||
|
|
||||||
|
const scaledGap: [number, number] = [gapX * viewport.value.zoom || 1, gapY * viewport.value.zoom || 1]
|
||||||
|
|
||||||
const scaledSize = size * viewport.value.zoom
|
const scaledSize = size * viewport.value.zoom
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user