From 0cab562e466352b9aaa409797e2efba7336554f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 May 2009 02:03:22 +0000 Subject: [PATCH] Workaround for size 1 brushes not working with projection paint, need to investigate why this wont work but for now just clamp the value while projection painting. --- source/blender/src/imagepaint.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/src/imagepaint.c b/source/blender/src/imagepaint.c index 1a6eb10b00b..e6b14497838 100644 --- a/source/blender/src/imagepaint.c +++ b/source/blender/src/imagepaint.c @@ -4438,6 +4438,7 @@ void imagepaint_paint(short mousebutton, short texpaint) BrushPainter *painter; ToolSettings *settings= G.scene->toolsettings; short prevmval[2], mval[2], project = 0; + short brush_size_orig; /* not nice hack because 1 size brushes always fail with projection paint */ double time; float pressure; int init = 1; @@ -4472,6 +4473,8 @@ void imagepaint_paint(short mousebutton, short texpaint) ps.brush = s.brush; ps.tool = s.tool; ps.blend = s.blend; + + brush_size_orig = ps.brush->size; /* hack, fixme */ } if(texpaint) { @@ -4535,6 +4538,10 @@ void imagepaint_paint(short mousebutton, short texpaint) persp(PERSP_WIN); return; } + + /* Dont allow brush size below 2 */ + if (ps.brush->size<=1) + ps.brush->size = 2; } settings->imapaint.flag |= IMAGEPAINT_DRAWING; @@ -4613,6 +4620,7 @@ void imagepaint_paint(short mousebutton, short texpaint) brush_painter_free(painter); if (project) { + ps.brush->size = brush_size_orig; project_paint_end(&ps); }