Skip to content

Commit 7db3139

Browse files
gmarullclaude
authored andcommitted
fw/applib/ui/dialogs: fix dialog icon animation offset for wider displays
The hardcoded DISP_OFFSET of 80 was insufficient for displays wider than 144px (e.g. obelix/robert at 200px), causing the icon slide-in animation to start on-screen instead of off-screen. Use DISP_COLS for the from-right offset and -icon_rect.size.w for the from-left offset to ensure the icon always starts fully off-screen on all display sizes. Fixes FIRM-1068 Signed-Off-By: Gerard Marull-Paretas <gerard@teslabs.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 55fcff9 commit 7db3139

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/fw/applib/ui/dialogs/dialog_private.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ bool dialog_init_icon_layer(Dialog *dialog, KinoReel *image,
114114
layer_set_clips(&icon_layer->layer, false);
115115

116116
GRect from = icon_rect;
117-
// Animate from off screen. We need to be at least -80, since that is our largest icon size.
118-
const int16_t DISP_OFFSET = 80;
117+
// Animate from off screen. Use display width to ensure icon starts fully off-screen
118+
// on all display sizes (e.g. 200px wide on obelix/robert).
119119
if (dialog->icon_anim_direction == DialogIconAnimationFromLeft) {
120-
from.origin.x = -DISP_OFFSET;
120+
from.origin.x = -icon_rect.size.w;
121121
} else if (dialog->icon_anim_direction == DialogIconAnimationFromRight) {
122-
from.origin.x = DISP_OFFSET;
122+
from.origin.x = DISP_COLS;
123123
}
124124

125125
const int16_t ICON_TARGET_PT_X = icon_rect.size.w;

0 commit comments

Comments
 (0)