Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): pixel-align mobile status indicator notch (#3399)

Hampusbe314788b381
diff --git a/fluxer_app/scripts/GenerateAvatarMasks.ts b/fluxer_app/scripts/GenerateAvatarMasks.ts
index 458e09890..0d879bb86 100644
--- a/fluxer_app/scripts/GenerateAvatarMasks.ts
+++ b/fluxer_app/scripts/GenerateAvatarMasks.ts
@@ -145,7 +145,8 @@ function calculateStatusGeometry(avatarSize: number, isMobile: boolean = false):
return baseGeometry;
}
const phoneWidth = statusSize;
- const phoneHeight = Math.round(phoneWidth / DESIGN_RULES.mobileAspectRatio) + DESIGN_RULES.mobilePhoneExtraHeight;
+ const phoneHeight =
+ Math.round((phoneWidth / DESIGN_RULES.mobileAspectRatio + DESIGN_RULES.mobilePhoneExtraHeight) / 2) * 2;
const phoneRx = Math.round(phoneWidth * DESIGN_RULES.mobileCornerRadius);
const bezelHeight = Math.max(1, Math.round(phoneHeight * 0.05));
const phoneX = cutoutCenter - phoneWidth / 2;