Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-07-02 19:48:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-02 19:55:24 +0300
commite35f9f0408a77422f0f7c1593dcabede69820527 (patch)
tree396535726e3aeab9e0d125eaeb5bc3fcd42ac025 /source/blender/editors/sculpt_paint/paint_image.c
parent12603826eac9bd7399e065987d3c583e2734b0a7 (diff)
parentdbe1b07e058db33a9e806d8e9808463d563d4aa5 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c63
1 files changed, 35 insertions, 28 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 02fd685719e..7f71270c52d 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -168,8 +168,9 @@ void imapaint_image_update(SpaceImage *sima, Image *image, ImBuf *ibuf, short te
if (imapaintpartial.x1 != imapaintpartial.x2 &&
imapaintpartial.y1 != imapaintpartial.y2)
{
- IMB_partial_display_buffer_update_delayed(ibuf, imapaintpartial.x1, imapaintpartial.y1,
- imapaintpartial.x2, imapaintpartial.y2);
+ IMB_partial_display_buffer_update_delayed(
+ ibuf, imapaintpartial.x1, imapaintpartial.y1,
+ imapaintpartial.x2, imapaintpartial.y2);
}
if (ibuf->mipmap[0])
@@ -339,15 +340,16 @@ typedef struct PaintOperation {
bool paint_use_opacity_masking(Brush *brush)
{
- return (brush->flag & BRUSH_AIRBRUSH) ||
- (brush->flag & BRUSH_DRAG_DOT) ||
- (brush->flag & BRUSH_ANCHORED) ||
- (brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
- (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) ||
- (brush->imagepaint_tool == PAINT_TOOL_FILL) ||
- (brush->flag & BRUSH_USE_GRADIENT) ||
- (brush->mtex.tex && !ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)) ?
- false : true;
+ return ((brush->flag & BRUSH_AIRBRUSH) ||
+ (brush->flag & BRUSH_DRAG_DOT) ||
+ (brush->flag & BRUSH_ANCHORED) ||
+ (brush->imagepaint_tool == PAINT_TOOL_SMEAR) ||
+ (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) ||
+ (brush->imagepaint_tool == PAINT_TOOL_FILL) ||
+ (brush->flag & BRUSH_USE_GRADIENT) ||
+ (brush->mtex.tex &&
+ !ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)) ?
+ false : true);
}
void paint_brush_color_get(
@@ -572,8 +574,9 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
paint_2d_gradient_fill(C, brush, pop->startmouse, pop->prevmouse, pop->custom_paint);
}
else {
- paint_proj_stroke(C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
- 1.0, 0.0, BKE_brush_size_get(scene, brush));
+ paint_proj_stroke(
+ C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
+ 1.0, 0.0, BKE_brush_size_get(scene, brush));
/* two redraws, one for GPU update, one for notification */
paint_proj_redraw(C, pop->custom_paint, false);
paint_proj_redraw(C, pop->custom_paint, true);
@@ -587,8 +590,9 @@ static void paint_stroke_done(const bContext *C, struct PaintStroke *stroke)
paint_2d_bucket_fill(C, color, brush, pop->prevmouse, pop->custom_paint);
}
else {
- paint_proj_stroke(C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
- 1.0, 0.0, BKE_brush_size_get(scene, brush));
+ paint_proj_stroke(
+ C, pop->custom_paint, pop->startmouse, pop->prevmouse, paint_stroke_flipped(stroke),
+ 1.0, 0.0, BKE_brush_size_get(scene, brush));
/* two redraws, one for GPU update, one for notification */
paint_proj_redraw(C, pop->custom_paint, false);
paint_proj_redraw(C, pop->custom_paint, true);
@@ -639,10 +643,11 @@ static int paint_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
int retval;
- op->customdata = paint_stroke_new(C, op, NULL, paint_stroke_test_start,
- paint_stroke_update_step,
- paint_stroke_redraw,
- paint_stroke_done, event->type);
+ op->customdata = paint_stroke_new(
+ C, op, NULL, paint_stroke_test_start,
+ paint_stroke_update_step,
+ paint_stroke_redraw,
+ paint_stroke_done, event->type);
if ((retval = op->type->modal(C, op, event)) == OPERATOR_FINISHED) {
paint_stroke_data_free(op);
@@ -670,10 +675,11 @@ static int paint_exec(bContext *C, wmOperator *op)
RNA_float_get_array(&firstpoint, "mouse", mouse);
- op->customdata = paint_stroke_new(C, op, NULL, paint_stroke_test_start,
- paint_stroke_update_step,
- paint_stroke_redraw,
- paint_stroke_done, 0);
+ op->customdata = paint_stroke_new(
+ C, op, NULL, paint_stroke_test_start,
+ paint_stroke_update_step,
+ paint_stroke_redraw,
+ paint_stroke_done, 0);
/* frees op->customdata */
return paint_stroke_exec(C, op);
}
@@ -882,11 +888,12 @@ static void sample_color_update_header(SampleColorData *data, bContext *C)
ScrArea *sa = CTX_wm_area(C);
if (sa) {
- BLI_snprintf(msg, sizeof(msg),
- IFACE_("Sample color for %s"),
- !data->sample_palette ?
- IFACE_("Brush. Use Left Click to sample for palette instead") :
- IFACE_("Palette. Use Left Click to sample more colors"));
+ BLI_snprintf(
+ msg, sizeof(msg),
+ IFACE_("Sample color for %s"),
+ !data->sample_palette ?
+ IFACE_("Brush. Use Left Click to sample for palette instead") :
+ IFACE_("Palette. Use Left Click to sample more colors"));
ED_workspace_status_text(C, msg);
}
}