diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-08 02:45:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-08 02:55:01 +0300 |
commit | a57b898d1760ade693983d1fd080399ab5e3367f (patch) | |
tree | b388152f5a114c1612ef57d9c5f8398dd763271f /source | |
parent | 7e52d810f3a1b6ba8732eb7ccab11ecf9cfbb09f (diff) |
BLF: Fix clamping drawing into byte buffer
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 087c7c7345e..1391e18748c 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -375,8 +375,8 @@ void blf_font_buffer(FontBLF *font, const char *str) if (buf_info->cbuf) { int yb = yb_start; - for (y = 0; y < height_clip; y++) { - for (x = 0; x < width_clip; x++) { + for (y = ((chy >= 0) ? 0 : -chy); y < height_clip; y++) { + for (x = ((chx >= 0) ? 0 : -chx); x < width_clip; x++) { a = *(g->bitmap + x + (yb * g->pitch)) / 255.0f; if (a > 0.0f) { |