From 7c32a5e824db74cf7fd7b9115105e944ddeab6e6 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 5 Jul 2026 04:33:12 +0200 Subject: [PATCH] Improved tag actor avatar size calculation. --- pages/scene/+Page.vue | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pages/scene/+Page.vue b/pages/scene/+Page.vue index f85e313..01aceba 100644 --- a/pages/scene/+Page.vue +++ b/pages/scene/+Page.vue @@ -505,21 +505,15 @@ function getFaceCrop(biometrics) { } if (leftEye && rightEye && mouth) { - const xs = [leftEye[0], rightEye[0], mouth[0]]; - const ys = [leftEye[1], rightEye[1], mouth[1]]; + const avgEyeY = (leftEye[1] + rightEye[1]) / 2; + const avgEyeX = (leftEye[0] + rightEye[0]) / 2; - const minX = Math.min(...xs); - const maxX = Math.max(...xs); - const minY = Math.min(...ys); - const maxY = Math.max(...ys); + const eyesToMouth = mouth[1] - avgEyeY; - const triangleWidth = maxX - minX; - const triangleHeight = maxY - minY; + const centerX = (avgEyeX + mouth[0]) / 2; + const centerY = (avgEyeY + mouth[1]) / 2; - const centerX = (minX + maxX) / 2; - const centerY = (minY + maxY) / 2; - - const size = Math.max(triangleWidth, triangleHeight) * avatarMargin; + const size = eyesToMouth * avatarMargin; return clampCrop({ left: centerX - size / 2,