diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-20 05:43:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-20 05:45:38 +0400 |
commit | 7436a3f4ce2069b7036cc56901f09270686bc0a5 (patch) | |
tree | b3bdf921189bf9fde4dabcb8cbdf51ab08805417 /source/blender/editors/interface/view2d_ops.c | |
parent | 60c53a5bdeff85a3abb72d2df84c44858637db5a (diff) |
Correction for recent commit clearing font cache
- move cache reset into view2d and comment about the rationale for resetting cache there.
- missed other places where view2d zoom level can change (smoothview, borderzoom, home and file reload)
- comment about DPI wasn't correct.
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index d299b72b881..dfd6a9fb48f 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -38,8 +38,6 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" -#include "BLF_api.h" - #include "BKE_context.h" #include "RNA_access.h" @@ -664,9 +662,7 @@ static void view_zoomstep_apply(bContext *C, wmOperator *op) /* cleanup temp customdata */ static void view_zoomstep_exit(wmOperator *op) { - /* Fonts are stored at each DPI level, without this we can easy load 100's of fonts. - * Not an issue with embedded font, but can use over 500Mo with i18n ones! See T38244. */ - BLF_cache_clear(); + UI_view2d_zoom_cache_reset(); if (op->customdata) { MEM_freeN(op->customdata); @@ -899,9 +895,7 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) /* cleanup temp customdata */ static void view_zoomdrag_exit(bContext *C, wmOperator *op) { - /* Fonts are stored at each DPI level, without this we can easy load 100's of fonts. - * Not an issue with embedded font, but can use over 500Mo with i18n ones! See T38244. */ - BLF_cache_clear(); + UI_view2d_zoom_cache_reset(); if (op->customdata) { v2dViewZoomData *vzd = op->customdata; @@ -1373,6 +1367,10 @@ static int view2d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), const w UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); ED_region_tag_redraw(ar); + if (v2d->sms == NULL) { + UI_view2d_zoom_cache_reset(); + } + return OPERATOR_FINISHED; } @@ -1865,9 +1863,11 @@ static int reset_exec(bContext *C, wmOperator *UNUSED(op)) ED_region_tag_redraw(ar); UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_COPY); + UI_view2d_zoom_cache_reset(); + return OPERATOR_FINISHED; } - + static void VIEW2D_OT_reset(wmOperatorType *ot) { /* identifiers */ |