diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-15 14:09:34 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-15 14:09:34 +0300 |
commit | 4858f9faab95d080fc595e56f620aa91750e7f5d (patch) | |
tree | 2093b4453308a968251d0dcc767c3f0ec9b4ed84 /source/blender/blenkernel/intern | |
parent | e3812b525f409d6f243c7ac6b1a52007148ad3e2 (diff) |
FIx merge issues, move preview resolution setting from RNA to BKE, do not clear preview when setting same resolution as current one.multi_previews_id
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/icons.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 838a732e387..26a3034f0c7 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -239,6 +239,25 @@ size_t BKE_previewimg_get_rect_size(struct PreviewImage *prv, const int size) } } +void BKE_previewimg_resolution_set(PreviewImage *prv, const int size, const int width, const int height) +{ + if (width == prv->w[size] && height == prv->h[size]) { + /* Same size, do nothing. */ + return; + } + + BKE_previewimg_clear_single(prv, size); + + if (width && height) { + prv->w[size] = width; + prv->h[size] = height; + + prv->rect[size] = MEM_callocN(BKE_previewimg_get_rect_size(prv, size), __func__); + } + + prv->flag[size] |= (PRV_CHANGED | PRV_USER_EDITED); +} + void BKE_previewimg_num_frames_set(struct PreviewImage *prv, const short num_frames) { BLI_assert(prv != NULL); |