diff options
author | Fabrice Bellet <fabrice@bellet.info> | 2025-06-25 09:04:48 +0000 |
---|---|---|
committer | Kate Hsuan <hpa@redhat.com> | 2025-06-25 17:04:48 +0800 |
commit | e7893f462476868a5d139d5260319bb0e9da28fe (patch) | |
tree | 665cf83d7327c02009c46708aab45df39c462793 | |
parent | fd4aaf3c6581d1de503c5d16696ac883ed9afd5a (diff) |
-rw-r--r-- | src/up-history.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/up-history.c b/src/up-history.c index 9f46017..fdeb14c 100644 --- a/src/up-history.c +++ b/src/up-history.c @@ -155,11 +155,11 @@ up_history_array_limit_resolution (GPtrArray *array, guint max_num) guint64 preset; item = (UpHistoryItem *) g_ptr_array_index (array, i); - preset = last + ((first - last) * (guint64) step) / max_num; + preset = first - ((first - last) * (guint64) step) / max_num; /* if state changed or we went over the preset do a new point */ if (count > 0 && - (up_history_item_get_time (item) > preset || + (up_history_item_get_time (item) < preset || up_history_item_get_state (item) != state)) { item_new = up_history_item_new (); up_history_item_set_time (item_new, time_s / count); |