diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-04-23 04:06:22 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-04-23 04:06:22 +0400 |
commit | 157244b13cf61d5889f5714167c6e5468ae35b15 (patch) | |
tree | e59778ab61ab8bf8823d245e96ed99885ed5729b /source/blender/blenkernel/intern/brush.c | |
parent | 0d14a1414c1c36f0e887c11de137f8b32a788852 (diff) |
Add stencil control for mask overlay. Key combinations are the same as
regular stencil but use Alt as well, so Alt-Rclick is translation, Alt-
clamping to avoid scaling of stencil to zero.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 064e902f831..e52d1d3b683 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -661,8 +661,8 @@ float BKE_brush_sample_masktex(const Scene *scene, Brush *br, float x = 0.0f, y = 0.0f; /* Quite warnings */ float co[3]; - x = point_2d[0] - br->stencil_pos[0]; - y = point_2d[1] - br->stencil_pos[1]; + x = point_2d[0] - br->mask_stencil_pos[0]; + y = point_2d[1] - br->mask_stencil_pos[1]; if (rotation > 0.001f || rotation < -0.001f) { const float angle = atan2f(y, x) + rotation; @@ -672,12 +672,12 @@ float BKE_brush_sample_masktex(const Scene *scene, Brush *br, y = flen * sinf(angle); } - if (fabsf(x) > br->stencil_dimension[0] || fabsf(y) > br->stencil_dimension[1]) { + if (fabsf(x) > br->mask_stencil_dimension[0] || fabsf(y) > br->mask_stencil_dimension[1]) { zero_v4(rgba); return 0.0f; } - x /= (br->stencil_dimension[0]); - y /= (br->stencil_dimension[1]); + x /= (br->mask_stencil_dimension[0]); + y /= (br->mask_stencil_dimension[1]); x *= mtex->size[0]; y *= mtex->size[1]; |