aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_x11.c2
-rw-r--r--pugl_cairo_test.c4
-rw-r--r--pugl_test.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c
index 03b696d..ef08ac8 100644
--- a/pugl/pugl_x11.c
+++ b/pugl/pugl_x11.c
@@ -35,8 +35,8 @@
#endif
#ifdef PUGL_HAVE_CAIRO
-#include <cairo/cairo.h>
#include <cairo/cairo-xlib.h>
+#include <cairo/cairo.h>
#endif
#include "pugl/cairo_gl.h"
diff --git a/pugl_cairo_test.c b/pugl_cairo_test.c
index c04c785..76c3ee7 100644
--- a/pugl_cairo_test.c
+++ b/pugl_cairo_test.c
@@ -85,8 +85,8 @@ buttonDraw(cairo_t* cr, const Button* but)
cairo_set_font_size(cr, 32.0);
cairo_text_extents(cr, but->label, &extents);
cairo_move_to(cr,
- (but->x + but->w / 2) - extents.width / 2,
- (but->y + but->h / 2) + extents.height / 2);
+ (but->x + but->w / 2.0) - extents.width / 2,
+ (but->y + but->h / 2.0) + extents.height / 2);
cairo_set_source_rgba(cr, 0, 0, 0, 1);
cairo_show_text(cr, but->label);
}
diff --git a/pugl_test.c b/pugl_test.c
index b0ea04d..fc3d921 100644
--- a/pugl_test.c
+++ b/pugl_test.c
@@ -85,7 +85,7 @@ static const float cubeVertices[] = {
static void
perspective(float* m, float fov, float aspect, float zNear, float zFar)
{
- const float h = tan(fov);
+ const float h = tanf(fov);
const float w = h / aspect;
const float depth = zNear - zFar;
const float q = (zFar + zNear) / depth;