mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #673] [Issue]: New-format avatar crops stretch in RP rectangle and glued-panel avatars #319
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#319
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Romuromylus on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/673
Originally assigned to: @Romuromylus on GitHub.
Summary
Avatars rendered in Roleplay-mode rectangle layouts (the "Small Rectangles" compact style and the "Glued Side Panel") apply the new source-rectangle avatar crop format directly, which stretches the cropped region to fit non-square aspect ratios. This affects both character avatars in the assistant bubble and user-persona avatars in the user bubble.
Expected behavior
The new-format crop should center the user's chosen focal point inside the rectangle without distortion. Legacy
{zoom, offsetX, offsetY}crops should continue to work as before (they compose withobject-coveras a CSS transform).Actual behavior
PR #671's
getAvatarCropStylefor new-format crops sets the<img>toposition: absolutewithwidth: 100/srcWidth%andheight: 100/srcHeight%, then usesobject-fit: fill. That math assumes the parent has the same aspect ratio as the crop (which the editor enforces to be square in source pixels).For the RP rectangular sites:
rpg-avatar-panel-tail/rpg-avatar-panel-media(glued side panel) — parent is taller than wide (or wider than tall when the message is short).compactAvatarFrameClasswhenuseCompactRectangleAvatar(small rectangles style) — parent is roughly2.75rem × 3.5rem(taller than wide).object-fit: fillon an<img>whose intrinsic aspect ratio differs from the parent's stretches it. Visible symptoms: glued panel shows a horizontally-squished face, small rectangles show a vertically-squished face, and short user-message panels (which render as wide rectangles) show only the top of the source (e.g. just the character's hair).Steps to reproduce
avatarCropsaved (square region of a non-square source image).Environment
51dbd59orec317b7)Logs, screenshots, or video
Reported by a Marinara user reproducing on a deployed instance. Symptoms vary based on message bubble height (panel adapts to the bubble) but the cause is the same: new-format crop math doesn't match non-square parent aspect ratios.
Additional context
The fix is straightforward: detect rectangular layout sites and, for new-format crops only, swap the absolute-positioned img sizing for
object-positionat the crop's center point.object-coverthen fills the rectangle without distortion while still respecting the user's chosen focal point. Legacy crops pass through unchanged. Round/square frames (Small Circles compact style, Conversation Mode bubble) continue to use PR #661's original logic.A follow-up PR with the patch is on the way.
Template check