Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-02 07:23:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-02 07:23:56 +0300
commitf305ed0c507005fdc1f3173e71e458527a1644d3 (patch)
treeb594bfe2d0ff16ddca8b10793cb5de7f42d0a6b0 /source
parent1dbc93b540ade1d7883bb9e3080e4581ddf2c4dc (diff)
use fixed width fonts for image stat display.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_image/CMakeLists.txt1
-rw-r--r--source/blender/editors/space_image/SConscript2
-rw-r--r--source/blender/editors/space_image/image_draw.c15
3 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt
index f8f2d04daed..67639539c40 100644
--- a/source/blender/editors/space_image/CMakeLists.txt
+++ b/source/blender/editors/space_image/CMakeLists.txt
@@ -21,6 +21,7 @@
SET(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../imbuf
diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript
index 295e03caf32..f51037642c4 100644
--- a/source/blender/editors/space_image/SConscript
+++ b/source/blender/editors/space_image/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
+incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../render/extern/include ../../makesrna'
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 48524d2728f..b781544c05b 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -56,6 +56,8 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
+#include "BLF_api.h"
+
#include "ED_gpencil.h"
#include "ED_image.h"
@@ -127,9 +129,9 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
char str[256];
int ofs;
- ofs= sprintf(str, "X: %d Y: %d ", x, y);
+ ofs= sprintf(str, "X: %4d Y: %4d ", x, y);
if(cp)
- ofs+= sprintf(str+ofs, "| R: %d G: %d B: %d A: %d ", cp[0], cp[1], cp[2], cp[3]);
+ ofs+= sprintf(str+ofs, "| R: %3d G: %3d B: %3d A: %3d ", cp[0], cp[1], cp[2], cp[3]);
if(fp) {
if(channels==4)
@@ -149,12 +151,17 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
glEnable(GL_BLEND);
glColor4f(.0,.0,.0,.25);
- glRectf(0.0, 0.0, ar->winrct.xmax - ar->winrct.xmin + 1, 30.0);
+ glRecti(0.0, 0.0, ar->winrct.xmax - ar->winrct.xmin + 1, 20);
glDisable(GL_BLEND);
glColor3ub(255, 255, 255);
- UI_DrawString(10, 10, str);
+ // UI_DrawString(6, 6, str); // works ok but fixed width is nicer.
+ BLF_aspect(blf_mono_font, 1.0);
+ BLF_size(blf_mono_font, 11, 72);
+ BLF_position(blf_mono_font, 6, 6, 0);
+ BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+
}
/* image drawing */