From c399c2947dd83feb837655195c567c7560e325c6 Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 9 Apr 2024 22:56:44 -0500 Subject: [PATCH] fix: Extra space of non-zero not applied properly --- bun.lockb | Bin 437792 -> 437792 bytes npm/src/geometry.ts | 8 ++++++-- web/composables/useBoardLayoutsQuery.ts | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bun.lockb b/bun.lockb index 13cf1284bbd5da7696e66fc7c741b92df6840f0b..81d0e42349e7bdf719f2220e887e906d0e43a7c8 100755 GIT binary patch delta 39 tcmZ2*M{2FEiBV3*%{+Z^$hgP+vioX05R+Kd6jHUCIBZ@4m1D& delta 39 qcmZ2*M{2FEiBV3*_jx?pnYB?3lOtzpI6D&WC8#Wo($gr diff --git a/npm/src/geometry.ts b/npm/src/geometry.ts index 0cad24b..66a4f29 100644 --- a/npm/src/geometry.ts +++ b/npm/src/geometry.ts @@ -68,9 +68,9 @@ export class Rectangle { }): Rectangle { // Adjust x, y, width, and height according to padding const x = this.x - (padding.left ?? 0); - const y = this.y - (padding.top ?? 0); + const y = this.y - (padding.bottom ?? 0); const width = this.width + (padding.left ?? 0) + (padding.right ?? 0); - const height = this.height + (padding.top ?? 0) + (padding.bottom ?? 0); + const height = this.height + (padding.bottom ?? 0) + (padding.top ?? 0); return new Rectangle(this.data, x, y, width, height); } @@ -142,6 +142,10 @@ export class BoardLayouter { readonly config: Config, ) { const padding = -new Distance(config.extraSpace).m; + console.log('PADDING', padding, { + a: stock, + b: stock.pad({ right: padding, top: padding }), + }); this.paddedStock = stock.pad({ right: padding, top: padding }); } diff --git a/web/composables/useBoardLayoutsQuery.ts b/web/composables/useBoardLayoutsQuery.ts index 07c5d0d..64809e9 100644 --- a/web/composables/useBoardLayoutsQuery.ts +++ b/web/composables/useBoardLayoutsQuery.ts @@ -16,6 +16,8 @@ export default function () { const layouts = computed(() => { const parts = partsQuery.data.value; if (parts == null) return undefined; + + console.log(toRaw(config.value)); return generateBoardLayouts(parts, stock.value, config.value); });