diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-16 20:04:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-16 20:13:23 +0400 |
commit | a780e7f3f09ffec99600a518a17b219b5aaee2c6 (patch) | |
tree | b6cc469fa8c76d61477ea3182a4e819653a7c4d4 /source/blender/makesrna/intern/rna_userdef.c | |
parent | de28a4d4b2c9397c5233a5ee1dbf1400f450a15c (diff) |
BLF: Fix for changing the DPI storing many fonts (300+)
Each dpi value stores its own set of font sizes, so while dragging the
dpi value would collect many sizes and never free.
Also change how BLF_cache_clear works,
it was freeing memory but not the OpenGL textures.
Now just free all the cache and GL textures and let drawing allocate them again as needed.
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index f4cb4701581..7b5c269ff0d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -111,6 +111,9 @@ static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe /* also used by buffer swap switching */ static void rna_userdef_dpi_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr)) { + /* font's are stored at each DPI level, without this we can easy load 100's of fonts */ + BLF_cache_clear(); + BKE_userdef_state(); WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */ WM_main_add_notifier(NC_SCREEN | NA_EDITED, NULL); /* refresh region sizes */ |