summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSven Neumann <sven@gimp.org>2002-12-20 14:55:28 +0000
committerSven Neumann <neo@src.gnome.org>2002-12-20 14:55:28 +0000
commit869bec21d4e9456fc2cdc2b3fd9b6b45cd791a94 (patch)
treec7a28e8f68774c8940408d7fe4901114d2c2d93b /examples
parent7ec4703c27ed6986edd530f0bdbf921a5ad4f2d0 (diff)
downloadgtk+-869bec21d4e9456fc2cdc2b3fd9b6b45cd791a94.tar.gz
use G_PI instead of M_PI.
2002-12-20 Sven Neumann <sven@gimp.org> * examples/gtkdial/gtkdial.c: use G_PI instead of M_PI.
Diffstat (limited to 'examples')
-rw-r--r--examples/gtkdial/gtkdial.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/examples/gtkdial/gtkdial.c b/examples/gtkdial/gtkdial.c
index 2ca738edb4..f557800d01 100644
--- a/examples/gtkdial/gtkdial.c
+++ b/examples/gtkdial/gtkdial.c
@@ -353,7 +353,7 @@ gtk_dial_expose (GtkWidget *widget,
if ((upper - lower) == 0)
return FALSE;
- increment = (100*M_PI) / (dial->radius*dial->radius);
+ increment = (100*G_PI) / (dial->radius*dial->radius);
inc = (upper - lower);
@@ -363,7 +363,7 @@ gtk_dial_expose (GtkWidget *widget,
for (i = 0; i <= inc; i++)
{
- theta = ((gfloat)i*M_PI / (18*inc/24.) - M_PI/6.);
+ theta = ((gfloat)i*G_PI / (18*inc/24.) - G_PI/6.);
if ((theta - last) < (increment))
continue;
@@ -558,17 +558,17 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y)
old_value = dial->adjustment->value;
dial->angle = atan2(yc-y, x-xc);
- if (dial->angle < -M_PI/2.)
- dial->angle += 2*M_PI;
+ if (dial->angle < -G_PI/2.)
+ dial->angle += 2*G_PI;
- if (dial->angle < -M_PI/6)
- dial->angle = -M_PI/6;
+ if (dial->angle < -G_PI/6)
+ dial->angle = -G_PI/6;
- if (dial->angle > 7.*M_PI/6.)
- dial->angle = 7.*M_PI/6.;
+ if (dial->angle > 7.*G_PI/6.)
+ dial->angle = 7.*G_PI/6.;
- dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) *
- (dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.);
+ dial->adjustment->value = dial->adjustment->lower + (7.*G_PI/6 - dial->angle) *
+ (dial->adjustment->upper - dial->adjustment->lower) / (4.*G_PI/3.);
if (dial->adjustment->value != old_value)
{
@@ -615,7 +615,7 @@ gtk_dial_update (GtkDial *dial)
g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed");
}
- dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. /
+ dial->angle = 7.*G_PI/6. - (new_value - dial->adjustment->lower) * 4.*G_PI/3. /
(dial->adjustment->upper - dial->adjustment->lower);
gtk_widget_queue_draw (GTK_WIDGET (dial));