[Bf-blender-cvs] [7cc52cc] asset-experiments: Fix bad ID preview clearing in RNA API.
Bastien Montagne
noreply at git.blender.org
Wed Jun 3 17:08:12 CEST 2015
Commit: 7cc52cc8dd66ba9333221dcf7dab45850b7df500
Author: Bastien Montagne
Date: Wed Jun 3 16:55:35 2015 +0200
Branches: asset-experiments
https://developer.blender.org/rB7cc52cc8dd66ba9333221dcf7dab45850b7df500
Fix bad ID preview clearing in RNA API.
Logic here was piece of crap... sigh.
===================================================================
M source/blender/makesrna/intern/rna_ID.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index cebf3e6..6910c04 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -457,14 +457,14 @@ static void rna_ImagePreview_size_set(PointerRNA *ptr, const int *values, enum e
BLI_assert(prv_img == BKE_previewimg_id_ensure(id));
}
- BKE_previewimg_ensure(prv_img, size);
+ BKE_previewimg_clear_single(prv_img, size);
if (values[0] && values[1]) {
prv_img->rect[size] = MEM_callocN(values[0] * values[1] * sizeof(unsigned int), "prv_rect");
- }
- prv_img->w[size] = values[0];
- prv_img->h[size] = values[1];
+ prv_img->w[size] = values[0];
+ prv_img->h[size] = values[1];
+ }
prv_img->flag[size] |= (PRV_CHANGED | PRV_USER_EDITED);
}
More information about the Bf-blender-cvs
mailing list