Skip to content

Commit

Permalink
Fix Stage to scrolling issue (Addresses pebble#163)
Browse files Browse the repository at this point in the history
Stage was using the same content size resizing logic as Card which
requires the same fix. Don't update the content size unless necessary
since updating the content size cancels the scroll animation on certain
firmware versions.
  • Loading branch information
Meiguro committed May 17, 2016
1 parent df544c0 commit 382c116
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/simply/simply_stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ static void layer_update_callback(Layer *layer, GContext *ctx) {
if (self->window.is_scrollable) {
frame.origin = GPointZero;
layer_set_frame(layer, frame);
scroll_layer_set_content_size(self->window.scroll_layer, frame.size);
const GSize content_size = scroll_layer_get_content_size(self->window.scroll_layer);
if (!gsize_equal(&frame.size, &content_size)) {
scroll_layer_set_content_size(self->window.scroll_layer, frame.size);
}
}
}

Expand Down

0 comments on commit 382c116

Please sign in to comment.