mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
fix: image thumbnail position (#731)
This commit is contained in:
parent
85316d0518
commit
c68c7ad507
1 changed files with 6 additions and 3 deletions
|
@ -35,9 +35,12 @@ const aspectRatio = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
const objectPosition = computed(() => {
|
const objectPosition = computed(() => {
|
||||||
return [attachment.meta?.focus?.x, attachment.meta?.focus?.y]
|
const focusX = attachment.meta?.focus?.x || 0
|
||||||
.map(v => v ? `${v * 100}%` : '50%')
|
const focusY = attachment.meta?.focus?.y || 0
|
||||||
.join(' ')
|
const x = ((focusX / 2) + 0.5) * 100
|
||||||
|
const y = ((focusY / -2) + 0.5) * 100
|
||||||
|
|
||||||
|
return `${x}% ${y}%`
|
||||||
})
|
})
|
||||||
|
|
||||||
const typeExtsMap = {
|
const typeExtsMap = {
|
||||||
|
|
Loading…
Reference in a new issue