From b32b9ceb583200626d5761c7830f933a812444dc Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 9 Oct 2018 19:24:42 +0200 Subject: [PATCH] Constant radian/degree factor --- libs/gtkmm2ext/utils.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index 06cd0b82a9..7e340be791 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -686,7 +686,7 @@ Gtkmm2ext::rounded_right_half_rectangle (Cairo::RefPtr context, void Gtkmm2ext::rounded_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_arc (cr, x + w - r, y + r, r, -90 * degrees, 0 * degrees); //tr @@ -699,7 +699,7 @@ Gtkmm2ext::rounded_rectangle (cairo_t* cr, double x, double y, double w, double void Gtkmm2ext::rounded_left_half_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_line_to (cr, x+w, y); // tr @@ -712,7 +712,7 @@ Gtkmm2ext::rounded_left_half_rectangle (cairo_t* cr, double x, double y, double void Gtkmm2ext::rounded_right_half_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_arc (cr, x + w - r, y + r, r, -90 * degrees, 0 * degrees); //tr @@ -725,7 +725,7 @@ Gtkmm2ext::rounded_right_half_rectangle (cairo_t* cr, double x, double y, double void Gtkmm2ext::rounded_top_half_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_move_to (cr, x+w, y+h); @@ -738,7 +738,7 @@ Gtkmm2ext::rounded_top_half_rectangle (cairo_t* cr, double x, double y, double w void Gtkmm2ext::rounded_bottom_half_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_move_to (cr, x, y); @@ -752,7 +752,7 @@ Gtkmm2ext::rounded_bottom_half_rectangle (cairo_t* cr, double x, double y, doubl void Gtkmm2ext::rounded_top_rectangle (cairo_t* cr, double x, double y, double w, double h, double r) { - double degrees = M_PI / 180.0; + static const double degrees = M_PI / 180.0; cairo_new_sub_path (cr); cairo_move_to (cr, x+w, y+h);