Skip to content

Commit

Permalink
Fix StatusComplication image alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
thirtythreeforty committed Jun 21, 2016
1 parent c065f08 commit 4bd0eca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/complications/StatusComplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ StatusComplication::StatusComplication(GRect frame)
// size, which should be always true.
const GRect batt_image_size = gbitmap_get_bounds(low_battery_image);

const int16_t image_separation = 5;
const int16_t total_image_height = bluetooth_image_size.size.h +
batt_image_size.size.h + image_separation;

const GRect bluetooth_layer_location =
GRect((int16_t)(center.x - bluetooth_image_size.size.w / 2),
(int16_t)((center.y - bluetooth_image_size.size.h) / 2),
(int16_t)(center.y - total_image_height / 2),
(int16_t)bluetooth_image_size.size.w,
(int16_t)bluetooth_image_size.size.h);
no_bluetooth_layer = bitmap_layer_create(bluetooth_layer_location);
Expand All @@ -27,7 +31,7 @@ StatusComplication::StatusComplication(GRect frame)

const GRect batt_layer_location =
GRect((int16_t)(center.x - batt_image_size.size.w / 2),
(int16_t)(center.y / 2 + center.y - batt_image_size.size.h / 2),
(int16_t)(center.y - total_image_height / 2 + bluetooth_image_size.size.h + image_separation),
(int16_t)batt_image_size.size.w,
(int16_t)batt_image_size.size.h);
battery_layer = bitmap_layer_create(batt_layer_location);
Expand Down

0 comments on commit 4bd0eca

Please sign in to comment.