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>2013-01-16 23:22:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-16 23:22:15 +0400
commit337695d4967f99edd5163a639d0f7a884fcd27c8 (patch)
treecfa4b2774866fc14633d987127249903d6229811 /source/blender/editors/sculpt_paint
parent6e7ee2649d108e680d4d25f6f2d382022fd0bb75 (diff)
draw the brush size with pressure applied (when the tablet is used), nice to see the actual size used.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 5f241f0d9cc..ec8d60ce62a 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -595,6 +595,18 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
/* draw brush outline */
glTranslatef(translation[0], translation[1], 0);
+
+ /* draw an inner brush */
+ if (BKE_brush_use_size_pressure(scene, brush)) {
+ const wmWindow *win = CTX_wm_window(C);
+ const float pressure = WM_cursor_pressure(win);
+ if (pressure != -1.0f && pressure != 0.0f) {
+ /* inner at full alpha */
+ glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius * pressure, 40);
+ /* outer at half alpha */
+ glColor4f(outline_col[0], outline_col[1], outline_col[2], outline_alpha * 0.5f);
+ }
+ }
glutil_draw_lined_arc(0.0, M_PI * 2.0, final_radius, 40);
glTranslatef(-translation[0], -translation[1], 0);