X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftint2;a=blobdiff_plain;f=src%2Fbattery%2Fbattery.c;h=04c993486b8740c7938cbb401ac194a7580f783e;hp=faf27e9f5a1596a99ee065aac8650c4c0d452f59;hb=5ba60d0bf84eeb901ac0eaeb376e00f116b75c28;hpb=87acd48b92031b378887ea8b7ea9fa54aea8fa25 diff --git a/src/battery/battery.c b/src/battery/battery.c index faf27e9..04c9934 100644 --- a/src/battery/battery.c +++ b/src/battery/battery.c @@ -460,8 +460,8 @@ int resize_battery(void *obj) if (new_size > battery->area.width || new_size < (battery->area.width-2)) { // we try to limit the number of resize battery->area.width = new_size; - battery->bat1_posy = ((battery->area.height - bat_percentage_height) / 2) - ((bat_time_height_ink + 2) / 2); - battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2 - (bat_percentage_height - bat_percentage_height_ink)/2 - (bat_time_height - bat_time_height_ink)/2; + battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height)/2; + battery->bat2_posy = battery->bat1_posy + bat_percentage_height; ret = 1; } } @@ -469,8 +469,8 @@ int resize_battery(void *obj) int new_size = bat_percentage_height + bat_time_height + (2 * (battery->area.paddingxlr + battery->area.bg->border.width)); if (new_size > battery->area.height || new_size < (battery->area.height-2)) { battery->area.height = new_size; - battery->bat1_posy = ((battery->area.height - bat_percentage_height) / 2) - ((bat_time_height_ink + 2) / 2); - battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2 - (bat_percentage_height - bat_percentage_height_ink)/2 - (bat_time_height - bat_time_height_ink)/2; + battery->bat1_posy = (battery->area.height - bat_percentage_height - bat_time_height - 2)/2; + battery->bat2_posy = battery->bat1_posy + bat_percentage_height + 2; ret = 1; } }