[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55414] trunk/blender/source/blender: Fix: Clamp alpha to 1.0 or adding alpha in paint creates "isolines" due
Antony Riakiotakis
kalast at gmail.com
Tue Mar 19 14:32:57 CET 2013
Revision: 55414
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55414
Author: psy-fi
Date: 2013-03-19 13:32:57 +0000 (Tue, 19 Mar 2013)
Log Message:
-----------
Fix: Clamp alpha to 1.0 or adding alpha in paint creates "isolines" due
to integer overflow. One of the beautiful bugs that is sad to see fixed.
Also remove unused timer variable
Modified Paths:
--------------
trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
trunk/blender/source/blender/imbuf/intern/rectop.c
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2013-03-19 13:31:54 UTC (rev 55413)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c 2013-03-19 13:32:57 UTC (rev 55414)
@@ -398,7 +398,6 @@
double starttime;
ViewContext vc;
- wmTimer *timer;
} PaintOperation;
void paint_brush_init_tex(Brush *brush)
@@ -531,9 +530,6 @@
paint_redraw(C, pop, 1);
- if (pop->timer)
- WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), pop->timer);
-
settings->imapaint.flag &= ~IMAGEPAINT_DRAWING;
if (pop->mode == PAINT_MODE_3D_PROJECT) {
Modified: trunk/blender/source/blender/imbuf/intern/rectop.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/rectop.c 2013-03-19 13:31:54 UTC (rev 55413)
+++ trunk/blender/source/blender/imbuf/intern/rectop.c 2013-03-19 13:32:57 UTC (rev 55414)
@@ -138,7 +138,7 @@
cp[0] = cp1[0];
cp[1] = cp1[1];
cp[2] = cp1[2];
- cp[3] = (temp < 0) ? 0 : temp;
+ cp[3] = (temp > 255)? 255 : ((temp < 0) ? 0 : temp);
}
@@ -269,6 +269,7 @@
cp[3] = (cp1[3] + fac * cp2[3]);
if (cp[3] < 0.0f) cp[3] = 0.0f;
+ if (cp[3] > 1.0f) cp[3] = 1.0f;
}
void IMB_blend_color_float(float *dst, float *src1, float *src2, float fac, IMB_BlendMode mode)
More information about the Bf-blender-cvs
mailing list