Remove sincos use

It turns out to be not worth the portability pain. Bug 593877
This commit is contained in:
Matthias Clasen
2009-09-02 22:11:28 -04:00
parent 36a73586ce
commit 908b6620bd

View File

@ -3,7 +3,6 @@
* Offscreen windows can be used to transform parts of a widget * Offscreen windows can be used to transform parts of a widget
* hierarchy. Note that the rotated button is fully functional. * hierarchy. Note that the rotated button is fully functional.
*/ */
#define _GNU_SOURCE
#include <math.h> #include <math.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
@ -73,7 +72,8 @@ to_child (GtkRotatedBin *bin,
double c, s; double c, s;
double w, h; double w, h;
sincos (bin->angle, &s, &c); s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation; child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height; w = c * child_area.width + s * child_area.height;
@ -112,7 +112,8 @@ to_parent (GtkRotatedBin *bin,
double c, s; double c, s;
double w, h; double w, h;
sincos (bin->angle, &s, &c); s = sin (bin->angle);
c = cos (bin->angle);
child_area = bin->child->allocation; child_area = bin->child->allocation;
w = c * child_area.width + s * child_area.height; w = c * child_area.width + s * child_area.height;
@ -384,7 +385,8 @@ gtk_rotated_bin_size_request (GtkWidget *widget,
if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
gtk_widget_size_request (bin->child, &child_requisition); gtk_widget_size_request (bin->child, &child_requisition);
sincos (bin->angle, &s, &c); s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_requisition.width + s * child_requisition.height; w = c * child_requisition.width + s * child_requisition.height;
h = s * child_requisition.width + c * child_requisition.height; h = s * child_requisition.width + c * child_requisition.height;
@ -419,7 +421,8 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget,
GtkRequisition child_requisition; GtkRequisition child_requisition;
GtkAllocation child_allocation; GtkAllocation child_allocation;
sincos (bin->angle, &s, &c); s = sin (bin->angle);
c = cos (bin->angle);
gtk_widget_get_child_requisition (bin->child, &child_requisition); gtk_widget_get_child_requisition (bin->child, &child_requisition);
child_allocation.x = 0; child_allocation.x = 0;
@ -479,7 +482,8 @@ gtk_rotated_bin_expose (GtkWidget *widget,
cr = gdk_cairo_create (widget->window); cr = gdk_cairo_create (widget->window);
/* transform */ /* transform */
sincos (bin->angle, &s, &c); s = sin (bin->angle);
c = cos (bin->angle);
w = c * child_area.width + s * child_area.height; w = c * child_area.width + s * child_area.height;
h = s * child_area.width + c * child_area.height; h = s * child_area.width + c * child_area.height;