fix: image thumbnail position (#731)

pull/806/head
Ivan Demchuk 2023-01-05 18:49:59 +02:00 zatwierdzone przez GitHub
rodzic 85316d0518
commit c68c7ad507
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -35,9 +35,12 @@ const aspectRatio = computed(() => {
})
const objectPosition = computed(() => {
return [attachment.meta?.focus?.x, attachment.meta?.focus?.y]
.map(v => v ? `${v * 100}%` : '50%')
.join(' ')
const focusX = attachment.meta?.focus?.x || 0
const focusY = attachment.meta?.focus?.y || 0
const x = ((focusX / 2) + 0.5) * 100
const y = ((focusY / -2) + 0.5) * 100
return `${x}% ${y}%`
})
const typeExtsMap = {