🆙 Fix heads in avatar editor

This commit is contained in:
DuckieTM
2026-03-22 21:23:34 +01:00
parent ccaec9185e
commit 868543457f
3 changed files with 6 additions and 3240 deletions
@@ -160,9 +160,13 @@ export class AvatarEditorThumbnailsHelper
if(isDisabled) sprite.filters = [ AvatarEditorThumbnailsHelper.ALPHA_FILTER ];
const headSize = Math.floor(texture.width * 0.5);
const cropX = Math.floor((texture.width - headSize) / 2);
const cropY = Math.floor(texture.height * 0.22);
const imageUrl = await TextureUtils.generateImageUrl({
target: sprite,
frame: new NitroRectangle(0, 0, texture.width, texture.height)
frame: new NitroRectangle(cropX, cropY, headSize, headSize)
});
sprite.destroy();
@@ -51,7 +51,7 @@ export const AvatarEditorFigureSetItemView: FC<{
if(!partItem) return null;
return (
<InfiniteGrid.Item itemActive={ isSelected } itemImage={ (partItem.isClear ? undefined : assetUrl) } className={ `avatar-parts mx-auto${ isSelected ? ' part-selected' : '' }` } style={ { backgroundPosition: (setType === AvatarFigurePartType.HEAD) ? 'center -35px' : 'center' } } { ...rest }>
<InfiniteGrid.Item itemActive={ isSelected } itemImage={ (partItem.isClear ? undefined : assetUrl) } className={ `avatar-parts mx-auto${ isSelected ? ' part-selected' : '' }` } style={ (setType === AvatarFigurePartType.HEAD) ? { backgroundSize: 'cover', backgroundPosition: 'center' } : { backgroundPosition: 'center' } } { ...rest }>
{ !partItem.isClear && isHC && <LayoutCurrencyIcon className="absolute inset-e-1 bottom-1" type="hc" /> }
{ partItem.isClear && <AvatarEditorIcon icon="clear" /> }
{ !partItem.isClear && partItem.partSet.isSellable && <AvatarEditorIcon className="inset-e-1 bottom-1 absolute" icon="sellable" /> }
-3238
View File
File diff suppressed because it is too large Load Diff