summaryrefslogtreecommitdiff
path: root/gtk/gtkhsv.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2000-05-16 21:27:10 +0000
committerTor Lillqvist <tml@src.gnome.org>2000-05-16 21:27:10 +0000
commit8596f7edc559f94f6daeb593d298e9c78b0bf40d (patch)
tree3177e0bce7517422ddec629eb730aa285e33638c /gtk/gtkhsv.c
parent386ae2097042d60afa3c4d4d4244161d16966b77 (diff)
downloadgtk+-8596f7edc559f94f6daeb593d298e9c78b0bf40d.tar.gz
Plug same refcount leaks as in the X11 backend.gdk-object-branchpoint
2000-05-17 Tor Lillqvist <tml@iki.fi> * gdk/win32/gdkevents-win32.c (gdk_event_translate): Plug same refcount leaks as in the X11 backend. * gdk/win32/gdkgc-win32.c (gdk_win32_gc_set_values): Logging cosmetics. * gdk/win32/gdkwindow-win32.c: Similar changes as in X11 backend. Add _gdk_windowing_window_destroy(). * gtk/gtkcolorsel.c: Include correct backend-specific header. Don't use XColor unless on X11. (No GDK_VISUAL_STATIC_COLOR either, but these probably do exist on nanox?) * gtk/gtkhsv.c: Use G_PI (fresh from <glib.h>) instead of M_PI which isn't necessarily defined by <math.h>. * gtk/gtkobject.c (gtk_object_init): Don't go up the class ancestry past GtkObject. * gtk/gtktypeutils.h: Mark GTK_TYPE_IDENTIFIER for export/import from DLL on Win32. * gtk/gtk.def: Update corresponding to recent changes. * gtk/makefile.{cygwin,msc}: Updates.
Diffstat (limited to 'gtk/gtkhsv.c')
-rw-r--r--gtk/gtkhsv.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gtk/gtkhsv.c b/gtk/gtkhsv.c
index 8ca57b66f7..03b6e14844 100644
--- a/gtk/gtkhsv.c
+++ b/gtk/gtkhsv.c
@@ -519,14 +519,14 @@ compute_triangle (GtkHSV *hsv,
center = priv->size / 2.0;
outer = priv->size / 2.0;
inner = outer - priv->ring_width;
- angle = priv->h * 2.0 * M_PI;
+ angle = priv->h * 2.0 * G_PI;
*hx = floor (center + cos (angle) * inner + 0.5);
*hy = floor (center - sin (angle) * inner + 0.5);
- *sx = floor (center + cos (angle + 2.0 * M_PI / 3.0) * inner + 0.5);
- *sy = floor (center - sin (angle + 2.0 * M_PI / 3.0) * inner + 0.5);
- *vx = floor (center + cos (angle + 4.0 * M_PI / 3.0) * inner + 0.5);
- *vy = floor (center - sin (angle + 4.0 * M_PI / 3.0) * inner + 0.5);
+ *sx = floor (center + cos (angle + 2.0 * G_PI / 3.0) * inner + 0.5);
+ *sy = floor (center - sin (angle + 2.0 * G_PI / 3.0) * inner + 0.5);
+ *vx = floor (center + cos (angle + 4.0 * G_PI / 3.0) * inner + 0.5);
+ *vy = floor (center - sin (angle + 4.0 * G_PI / 3.0) * inner + 0.5);
}
/* Computes whether a point is inside the hue ring */
@@ -673,9 +673,9 @@ compute_v (GtkHSV *hsv,
angle = atan2 (dy, dx);
if (angle < 0.0)
- angle += 2.0 * M_PI;
+ angle += 2.0 * G_PI;
- return angle / (2.0 * M_PI);
+ return angle / (2.0 * G_PI);
}
/* Event handlers */
@@ -891,9 +891,9 @@ paint_ring (GtkHSV *hsv,
angle = atan2 (dy, dx);
if (angle < 0.0)
- angle += 2.0 * M_PI;
+ angle += 2.0 * G_PI;
- hue = angle / (2.0 * M_PI);
+ hue = angle / (2.0 * G_PI);
r = hue;
g = 1.0;
@@ -958,8 +958,8 @@ paint_ring (GtkHSV *hsv,
gdk_draw_line (drawable, priv->gc,
-x + center, -y + center,
- -x + center + cos (priv->h * 2.0 * M_PI) * center,
- -y + center - sin (priv->h * 2.0 * M_PI) * center);
+ -x + center + cos (priv->h * 2.0 * G_PI) * center,
+ -y + center - sin (priv->h * 2.0 * G_PI) * center);
gdk_gc_set_clip_mask (priv->gc, NULL);
gdk_bitmap_unref (mask);