Commit 343574c6 authored by Manish Vachharajani's avatar Manish Vachharajani
Browse files

Make eraser sensitive to pressure from xinput devices

parent 2938ed8b
......@@ -160,6 +160,7 @@ static void
eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gboolean incremental)
{
GImage *gimage;
gint opacity;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
......@@ -178,9 +179,10 @@ eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gbo
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
opacity = OPAQUE_OPACITY * paint_core->curpressure;
if(opacity > 255) opacity=255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (get_brush_opacity () * 255),
ERASE_MODE, hard? HARD : SOFT, incremental ? INCREMENTAL : CONSTANT);
}
......
......@@ -160,6 +160,7 @@ static void
eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gboolean incremental)
{
GImage *gimage;
gint opacity;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
......@@ -178,9 +179,10 @@ eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gbo
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
opacity = OPAQUE_OPACITY * paint_core->curpressure;
if(opacity > 255) opacity=255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (get_brush_opacity () * 255),
ERASE_MODE, hard? HARD : SOFT, incremental ? INCREMENTAL : CONSTANT);
}
......
......@@ -160,6 +160,7 @@ static void
eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gboolean incremental)
{
GImage *gimage;
gint opacity;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
......@@ -178,9 +179,10 @@ eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gbo
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
opacity = OPAQUE_OPACITY * paint_core->curpressure;
if(opacity > 255) opacity=255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (get_brush_opacity () * 255),
ERASE_MODE, hard? HARD : SOFT, incremental ? INCREMENTAL : CONSTANT);
}
......
......@@ -160,6 +160,7 @@ static void
eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gboolean incremental)
{
GImage *gimage;
gint opacity;
TempBuf * area;
unsigned char col[MAX_CHANNELS];
......@@ -178,9 +179,10 @@ eraser_motion (PaintCore *paint_core, GimpDrawable *drawable, gboolean hard, gbo
/* color the pixels */
color_pixels (temp_buf_data (area), col,
area->width * area->height, area->bytes);
opacity = OPAQUE_OPACITY * paint_core->curpressure;
if(opacity > 255) opacity=255;
/* paste the newly painted canvas to the gimage which is being worked on */
paint_core_paste_canvas (paint_core, drawable, OPAQUE_OPACITY,
paint_core_paste_canvas (paint_core, drawable, opacity,
(int) (get_brush_opacity () * 255),
ERASE_MODE, hard? HARD : SOFT, incremental ? INCREMENTAL : CONSTANT);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment