feat: 8 perimeter resize handles (static divs, no .map, typed callbacks)
This commit is contained in:
1 parent
b6c0a58071
commit
be419351b2
2 files changed
+20
-37
No files matched your search
+3
-3
@@ -137,13 +137,13 @@ export default function () {
|
||||
const size = clampWindowSize({ width, height })
|
||||
figma.ui.resize(size.width, size.height)
|
||||
lastSize = { width: size.width, height: size.height }
|
||||
if (dir.includes('left') || dir.includes('top')) {
|
||||
if (dir.indexOf('left') !== -1 || dir.indexOf('top') !== -1) {
|
||||
const zoom = figma.viewport.zoom || 1
|
||||
const p = getPos()
|
||||
let nx = p.x
|
||||
let ny = p.y
|
||||
if (dir.includes('left')) nx = p.x - dx / zoom
|
||||
if (dir.includes('top')) ny = p.y - dy / zoom
|
||||
if (dir.indexOf('left') !== -1) nx = p.x - dx / zoom
|
||||
if (dir.indexOf('top') !== -1) ny = p.y - dy / zoom
|
||||
figma.ui.reposition(nx, ny)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user