diff options
author | rbuj <[email protected]> | 2020-02-08 10:25:52 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2020-03-09 19:35:41 +0100 |
commit | 29762c0d0be64bccfcda3f59241e12dca92ec2aa (patch) | |
tree | b8bc783f45451b2a26d8f1f16d5b36c63eaf7714 /savers | |
parent | 33ea5f63b47a0dfb5dace73dd27f63f2c1b8d05c (diff) | |
download | mate-screensaver-29762c0d0be64bccfcda3f59241e12dca92ec2aa.tar.bz2 mate-screensaver-29762c0d0be64bccfcda3f59241e12dca92ec2aa.tar.xz |
floaters: use fabs instead of abs for doubles
Diffstat (limited to 'savers')
-rw-r--r-- | savers/floaters.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/savers/floaters.c b/savers/floaters.c index 94b04fc..99b99a1 100644 --- a/savers/floaters.c +++ b/savers/floaters.c @@ -417,7 +417,7 @@ screen_saver_floater_should_come_on_screen (ScreenSaver *screen_saver, if (!screen_saver_floater_is_off_canvas (screen_saver, floater)) return FALSE; - if ((abs (performance_ratio - .5) >= G_MINDOUBLE) && + if ((fabs (performance_ratio - .5) >= G_MINDOUBLE) && (g_random_double () > .5)) { if (duration) @@ -582,7 +582,7 @@ screen_saver_floater_create_path (ScreenSaver *screen_saver, performance_ratio = screen_saver_get_frames_per_second (screen_saver) / OPTIMAL_FRAME_RATE; - if (abs (performance_ratio) <= G_MINDOUBLE) + if (fabs (performance_ratio) <= G_MINDOUBLE) performance_ratio = 1.0; if (screen_saver_floater_should_bubble_up (screen_saver, floater, performance_ratio, &duration)) @@ -732,7 +732,7 @@ screen_saver_floater_do_draw (ScreenSaver *screen_saver, cairo_save (context); - if (screen_saver->should_do_rotations && (abs (floater->angle) > G_MINDOUBLE)) + if (screen_saver->should_do_rotations && (fabs (floater->angle) > G_MINDOUBLE)) { floater->bounds.width = G_SQRT2 * source->width + 2; floater->bounds.height = G_SQRT2 * source->height + 2; @@ -1001,7 +1001,7 @@ compare_floaters (ScreenSaverFloater *a, { if (a->scale > b->scale) return 1; - else if (abs (a->scale - b->scale) <= G_MINDOUBLE) + else if (fabs (a->scale - b->scale) <= G_MINDOUBLE) return 0; else return -1; @@ -1133,7 +1133,7 @@ screen_saver_do_update_stats (ScreenSaver *screen_saver) screen_saver_get_timestamp (screen_saver); screen_saver->last_calculated_stats_time = last_calculated_stats_time; - if (abs (last_calculated_stats_time) <= G_MINDOUBLE) + if (fabs (last_calculated_stats_time) <= G_MINDOUBLE) return TRUE; seconds_since_last_stats_update = |