bugfix [#24439] Smear 2D paint fails
authorCampbell Barton <ideasman42@gmail.com>
Thu, 28 Oct 2010 19:40:05 +0000 (19:40 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 28 Oct 2010 19:40:05 +0000 (19:40 +0000)
small unrelated change: when setting the image type of an image, loop over all its Imbufs and set them.

source/blender/editors/sculpt_paint/paint_image.c
source/blender/makesrna/intern/rna_image.c

index a5b5baad4c56c19562c9c6ae5d4fab292be4b4d9..939955353c8537c0520c26bb6d89c7f8cb754204 100644 (file)
@@ -4178,7 +4178,7 @@ static void imapaint_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos)
        int a, tot;
 
        imapaint_set_region(region, 0, 0, pos[0], pos[1], ibufb->x, ibufb->y);
-       tot= imapaint_torus_split_region(region, ibuf, ibufb);
+       tot= imapaint_torus_split_region(region, ibufb, ibuf);
 
        for(a=0; a<tot; a++)
                IMB_rectblend(ibufb, ibuf, region[a].destx, region[a].desty,
index 92c860a80743a94458c873d3de5d1e3a0105decb..4ac7624e73150e4bd40b12556e5117ab1df5d0b2 100644 (file)
@@ -171,9 +171,19 @@ static void rna_Image_file_format_set(PointerRNA *ptr, int value)
 {
        Image *image= (Image*)ptr->data;
        if(BKE_imtype_is_movie(value) == 0) { /* should be able to throw an error here */
-               ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
+               ImBuf *ibuf;
+               int ftype= BKE_imtype_to_ftype(value);
+
+               /*
+               ibuf= BKE_image_get_ibuf(image, NULL);
                if(ibuf)
-                       ibuf->ftype= BKE_imtype_to_ftype(value);
+                       ibuf->ftype= ftype;
+               */
+
+               /* to be safe change all buffer file types */
+               for(ibuf= image->ibufs.first; ibuf; ibuf->next) {
+                       ibuf->ftype= ftype;
+               }
        }
 }