add new mask blend mode: 'Merge Subtract'. gives better results when using feather...
[blender.git] / source / blender / blenkernel / intern / mask_rasterize.c
index d39be3b8ed62679f3f0672b850d1a92e48c2bdcf..48e55601469eaabc62a0771bdf53136d198e1d8f 100644 (file)
@@ -1282,9 +1282,12 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x
                }
 
                switch (layer->blend) {
-                       case MASK_BLEND_MERGE:
+                       case MASK_BLEND_MERGE_ADD:
                                value += value_layer * (1.0f - value);
                                break;
+                       case MASK_BLEND_MERGE_SUBTRACT:
+                               value -= value_layer * value;
+                               break;
                        case MASK_BLEND_ADD:
                                value += value_layer;
                                break;