diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-01-27 17:52:43 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-01-27 18:07:17 +0300 |
commit | a4d07bafc650c9af15444b5e41ba1afaff1cb5a2 (patch) | |
tree | a2c377facb36ce98dab83184dc94e587b7ea59f6 | |
parent | f83aa830cd00ad9b8656e2806620d80cb56b3172 (diff) |
Cleanup: Moved update ratio stretching overlay to cache_finish
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_edit_uv.c | 11 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_engine.c | 7 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_private.h | 1 |
3 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c b/source/blender/draw/engines/overlay/overlay_edit_uv.c index d33136a3801..06ef56a212b 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.c +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c @@ -503,6 +503,16 @@ static void edit_uv_stretching_update_ratios(OVERLAY_Data *vedata) BLI_freelistN(&pd->edit_uv.totals); } +void OVERLAY_edit_uv_cache_finish(OVERLAY_Data *vedata) +{ + OVERLAY_StorageList *stl = vedata->stl; + OVERLAY_PrivateData *pd = stl->pd; + + if (pd->edit_uv.do_uv_stretching_overlay) { + edit_uv_stretching_update_ratios(vedata); + } +} + static void OVERLAY_edit_uv_draw_finish(OVERLAY_Data *vedata) { OVERLAY_StorageList *stl = vedata->stl; @@ -544,7 +554,6 @@ void OVERLAY_edit_uv_draw(OVERLAY_Data *vedata) } if (pd->edit_uv.do_uv_stretching_overlay) { - edit_uv_stretching_update_ratios(vedata); DRW_draw_pass(psl->edit_uv_stretching_ps); } diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 3e56ed7de5d..fc9ec7ecc22 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -486,7 +486,12 @@ static void OVERLAY_cache_finish(void *vedata) { OVERLAY_Data *data = vedata; OVERLAY_PrivateData *pd = data->stl->pd; - if (ELEM(pd->space_type, SPACE_IMAGE, SPACE_NODE)) { + + if (ELEM(pd->space_type, SPACE_IMAGE)) { + OVERLAY_edit_uv_cache_finish(vedata); + return; + } + if (ELEM(pd->space_type, SPACE_NODE)) { return; } diff --git a/source/blender/draw/engines/overlay/overlay_private.h b/source/blender/draw/engines/overlay/overlay_private.h index 2975fe70796..db43136e308 100644 --- a/source/blender/draw/engines/overlay/overlay_private.h +++ b/source/blender/draw/engines/overlay/overlay_private.h @@ -555,6 +555,7 @@ void OVERLAY_edit_particle_draw(OVERLAY_Data *vedata); void OVERLAY_edit_uv_init(OVERLAY_Data *vedata); void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata); +void OVERLAY_edit_uv_cache_finish(OVERLAY_Data *vedata); void OVERLAY_edit_uv_draw(OVERLAY_Data *vedata); void OVERLAY_extra_cache_init(OVERLAY_Data *vedata); |