فهرست منبع

fix: decrease Object Action Bar distance when below portal

Peng Xiao 2 سال پیش
والد
کامیت
9f66c25240
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      tldraw/apps/tldraw-logseq/src/components/ContextBar/ContextBar.tsx
  2. 1 1
      tldraw/packages/react/src/index.ts

+ 1 - 1
tldraw/apps/tldraw-logseq/src/components/ContextBar/ContextBar.tsx

@@ -29,7 +29,7 @@ const _ContextBar: TLContextBarComponent<Shape> = ({ shapes, offsets, hidden })
     const elm = rContextBar.current
     if (!elm) return
     const size = rSize.current ?? [0, 0]
-    const [x, y] = getContextBarTranslation(size, { ...offsets, bottom: offsets.bottom - 32 })
+    const [x, y] = getContextBarTranslation(size, offsets)
     elm.style.setProperty('transform', `translateX(${x}px) translateY(${y}px)`)
   }, [offsets])
 

+ 1 - 1
tldraw/packages/react/src/index.ts

@@ -14,7 +14,7 @@ export function getContextBarTranslation(barSize: number[], offset: TLOffset) {
   let y = 0
   if (offset.top < 116) {
     // Show on bottom
-    y = offset.height / 2 + 72
+    y = offset.height / 2 + 40
     // Too far down, move up
     if (offset.bottom < 140) {
       y += offset.bottom - 140