From 90d0f459c307a2a07d92f3ae3c4f185cad8db73a Mon Sep 17 00:00:00 2001 From: Jehan Date: Sat, 22 Nov 2025 16:51:23 +0100 Subject: [PATCH] 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. --- app/paint/gimpmybrushcore.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/paint/gimpmybrushcore.c b/app/paint/gimpmybrushcore.c index ac823e5ba8..5a6f7ec344 100644 --- a/app/paint/gimpmybrushcore.c +++ b/app/paint/gimpmybrushcore.c @@ -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;