Skip to content

Commit

Permalink
fix: decrease Object Action Bar distance when below portal
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 authored and tiensonqin committed Nov 28, 2022
1 parent 0d52026 commit 9f66c25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion tldraw/packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f66c25

Please sign in to comment.