From 887d517e3b745945d3c8f7e2dc6e1d791067d1e8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 5 Aug 2012 17:27:52 +0000 Subject: use define for 0.375 = GLA_PIXEL_OFS, used all over the interface. also use M_SQRT1_2 in math_rotation.c --- source/blender/editors/screen/area.c | 2 +- source/blender/editors/screen/glutil.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/screen') diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 47a086a2779..b4f1f4b3022 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -107,7 +107,7 @@ void ED_region_pixelspace(ARegion *ar) int width = ar->winrct.xmax - ar->winrct.xmin + 1; int height = ar->winrct.ymax - ar->winrct.ymin + 1; - wmOrtho2(-0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f); + wmOrtho2(-GLA_PIXEL_OFS, (float)width - GLA_PIXEL_OFS, -GLA_PIXEL_OFS, (float)height - GLA_PIXEL_OFS); glLoadIdentity(); } diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 5296c8615ab..a534124d2c0 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -674,7 +674,7 @@ void glaDefine2DArea(rcti *screen_rect) glViewport(screen_rect->xmin, screen_rect->ymin, sc_w, sc_h); glScissor(screen_rect->xmin, screen_rect->ymin, sc_w, sc_h); - /* The 0.375 magic number is to shift the matrix so that + /* The GLA_PIXEL_OFS magic number is to shift the matrix so that * both raster and vertex integer coordinates fall at pixel * centers properly. For a longer discussion see the OpenGL * Programming Guide, Appendix H, Correctness Tips. @@ -683,7 +683,7 @@ void glaDefine2DArea(rcti *screen_rect) glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, sc_w, 0.0, sc_h, -1, 1); - glTranslatef(0.375, 0.375, 0.0); + glTranslatef(GLA_PIXEL_OFS, GLA_PIXEL_OFS, 0.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); -- cgit v1.2.3