app: barrel_rotation arguments corresponds to the wheel value.

This last argument in libmypaint's mypaint_brush_stroke_to_2() is called
barrel_rotation. If you look at MyPaint's code (in particular file
gui/freehand.py), you see it is taken from GDK_AXIS_WHEEL of the input
event, which corresponds to our coords->wheel (there is this
long-standing question about the difference with GDK_AXIS_ROTATION
because as far as we know, this is probably the same value anyway; as
was explained to us by a Wacom developer long ago).

Unfortunately I can't test as we don't have any stylus with such barrel
rotation feature (and unfortunately this hardware feature is
discontinued and getting a stylus with this is extra-hard now), but that
should work. And at the very least, it does match with MyPaint's
implementation.
This commit is contained in:
Jehan 2025-11-22 16:51:23 +01:00
parent 1ce91e9508
commit 90d0f459c3

View file

@ -82,8 +82,7 @@ static void gimp_mybrush_core_motion (GimpPaintCore *paint_core
GimpSymmetry *sym,
guint32 time,
gfloat view_zoom,
gfloat view_rotation,
gfloat barrel_rotation);
gfloat view_rotation);
static void gimp_mybrush_core_create_brushes (GimpMybrushCore *mybrush,
GimpDrawable *drawable,
GimpPaintOptions *paint_options,
@ -234,7 +233,7 @@ gimp_mybrush_core_paint (GimpPaintCore *paint_core,
case GIMP_PAINT_STATE_MOTION:
gimp_mybrush_core_motion (paint_core, drawables->data, paint_options,
sym, time, mybrush_options->view_zoom,
mybrush_options->view_rotation, 1.0f);
mybrush_options->view_rotation);
break;
case GIMP_PAINT_STATE_FINISH:
@ -256,8 +255,7 @@ gimp_mybrush_core_motion (GimpPaintCore *paint_core,
GimpSymmetry *sym,
guint32 time,
gfloat view_zoom,
gfloat view_rotation,
gfloat barrel_rotation)
gfloat view_rotation)
{
GimpMybrushCore *mybrush = GIMP_MYBRUSH_CORE (paint_core);
MyPaintRectangle rect;
@ -307,7 +305,7 @@ gimp_mybrush_core_motion (GimpPaintCore *paint_core,
1.0f, /* Pretend the cursor hasn't moved in a while */
view_zoom,
view_rotation,
barrel_rotation);
coords.wheel);
}
dt = 0.015;
@ -378,7 +376,7 @@ gimp_mybrush_core_motion (GimpPaintCore *paint_core,
dt,
view_zoom,
view_rotation,
barrel_rotation);
coords.wheel);
}
mybrush->private->last_time = time;