diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-05 21:27:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-05 21:27:52 +0400 |
commit | 887d517e3b745945d3c8f7e2dc6e1d791067d1e8 (patch) | |
tree | d4c962031f7efb788d7b63705f155f92f4867219 /source/blender/windowmanager | |
parent | dfdfa06c27c6dc44cb3f05e0355279d9e16eab93 (diff) |
use define for 0.375 = GLA_PIXEL_OFS, used all over the interface.
also use M_SQRT1_2 in math_rotation.c
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_subwindow.c | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 8652870e280..66bb321e832 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -45,10 +45,11 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" +#include "BIF_gl.h" + #include "BKE_context.h" #include "BKE_global.h" - #include "GHOST_C-api.h" #include "ED_screen.h" @@ -505,8 +506,8 @@ static void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple) /* wmOrtho for the screen has this same offset */ ratiox = sizex; ratioy = sizey; - halfx = 0.375f; - halfy = 0.375f; + halfx = GLA_PIXEL_OFS; + halfy = GLA_PIXEL_OFS; /* texture rectangle has unnormalized coordinates */ if (triple->target == GL_TEXTURE_2D) { diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 0b9dc441227..529910d220e 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -141,7 +141,7 @@ void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4]) int width, height; wm_subwindow_getsize(win, swin->swinid, &width, &height); - orthographic_m4(mat, -0.375f, (float)width - 0.375f, -0.375f, (float)height - 0.375f, -100, 100); + orthographic_m4(mat, -GLA_PIXEL_OFS, (float)width - GLA_PIXEL_OFS, -GLA_PIXEL_OFS, (float)height - GLA_PIXEL_OFS, -100, 100); } else glGetFloatv(GL_PROJECTION_MATRIX, (float *)mat); @@ -175,7 +175,7 @@ int wm_subwindow_open(wmWindow *win, rcti *winrct) /* extra service */ wm_subwindow_getsize(win, swin->swinid, &width, &height); - 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(); return swin->swinid; @@ -229,7 +229,7 @@ void wm_subwindow_position(wmWindow *win, int swinid, rcti *winrct) /* extra service */ wmSubWindowSet(win, swinid); wm_subwindow_getsize(win, swinid, &width, &height); - 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); } else { printf("%s: Internal error, bad winid: %d\n", __func__, swinid); @@ -268,7 +268,7 @@ void wmSubWindowScissorSet(wmWindow *win, int swinid, rcti *srct) else glScissor(_curswin->winrct.xmin, _curswin->winrct.ymin, width, height); - 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(); glFlush(); |