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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-05-25 21:04:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-05-25 21:04:32 +0400
commit1bd58bdbf4fb6e5723adea04ebb6eb5ad2918297 (patch)
tree761cfd8c21643970884104de5d639fbb1e616bd4 /source/blender/blenkernel/intern/image.c
parent13f1ce8bdcef148adbed4749c7dd8f6a3e37f474 (diff)
= misc small stuff =
- own mistake in scene help text. - rename properties to have users as the prefix for better ordering. - use fixed height for stamp, gives better aligned text.
Diffstat (limited to 'source/blender/blenkernel/intern/image.c')
-rw-r--r--source/blender/blenkernel/intern/image.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 5588c8df161..39efd9fe72e 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -982,6 +982,7 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
struct StampData stamp_data;
float w, h, pad;
int x, y;
+ float h_fixed;
if (!rect && !rectf)
return;
@@ -998,16 +999,24 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
pad= BLF_width(mono, "--");
+ /* use 'h_fixed' rather then 'h', aligns better */
+ // BLF_width_and_height(mono, "^|/_AgPpJjlYy", &w, &h_fixed);
+ {
+ rctf box;
+ BLF_boundbox(mono, "^|/_AgPpJjlYy", &box);
+ h_fixed= box.ymax - box.ymin;
+ }
+
x= 0;
y= height;
if (stamp_data.file[0]) {
/* Top left corner */
- BLF_width_and_height(mono, stamp_data.file, &w, &h);
+ BLF_width_and_height(mono, stamp_data.file, &w, &h); h= h_fixed;
y -= h;
/* also a little of space to the background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+2);
/* and draw the text. */
BLF_position(mono, x, y, 0.0);
@@ -1019,11 +1028,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File */
if (stamp_data.note[0]) {
- BLF_width_and_height(mono, stamp_data.note, &w, &h);
+ BLF_width_and_height(mono, stamp_data.note, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y+1, 0.0);
BLF_draw_buffer(mono, stamp_data.note);
@@ -1034,11 +1043,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File (or Note) */
if (stamp_data.date[0]) {
- BLF_width_and_height(mono, stamp_data.date, &w, &h);
+ BLF_width_and_height(mono, stamp_data.date, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.date);
@@ -1049,11 +1058,11 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Top left corner, below File, Date or Note */
if (stamp_data.rendertime[0]) {
- BLF_width_and_height(mono, stamp_data.rendertime, &w, &h);
+ BLF_width_and_height(mono, stamp_data.rendertime, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.rendertime);
@@ -1064,10 +1073,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Bottom left corner, leaving space for timing */
if (stamp_data.marker[0]) {
- BLF_width_and_height(mono, stamp_data.marker, &w, &h);
+ BLF_width_and_height(mono, stamp_data.marker, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1079,10 +1088,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
/* Left bottom corner */
if (stamp_data.time[0]) {
- BLF_width_and_height(mono, stamp_data.time, &w, &h);
+ BLF_width_and_height(mono, stamp_data.time, &w, &h); h= h_fixed;
/* extra space for background */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1093,10 +1102,10 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.frame[0]) {
- BLF_width_and_height(mono, stamp_data.frame, &w, &h);
+ BLF_width_and_height(mono, stamp_data.frame, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1107,22 +1116,22 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.camera[0]) {
- BLF_width_and_height(mono, stamp_data.camera, &w, &h);
+ BLF_width_and_height(mono, stamp_data.camera, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
BLF_position(mono, x, y+3, 0.0);
BLF_draw_buffer(mono, stamp_data.camera);
}
if (stamp_data.scene[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Bottom right corner, with an extra space because blenfont is too strict! */
x= width - w - 2;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1130,14 +1139,14 @@ void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, i
}
if (stamp_data.strip[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Top right corner, with an extra space because blenfont is too strict! */
x= width - w - pad;
y= height - h;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.strip);