After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 529431 - Patch to add velocity dynamic to all paint tools
Patch to add velocity dynamic to all paint tools
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other All
: Normal enhancement
: 2.6
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2008-04-22 20:37 UTC by Alexia Death
Modified: 2008-05-22 16:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Velocity dynamics patch for paint tools. (42.59 KB, patch)
2008-04-22 20:38 UTC, Alexia Death
none Details | Review
Cleaned up patch (45.75 KB, patch)
2008-04-23 08:50 UTC, Michael Natterer
none Details | Review
Updated patch (44.75 KB, patch)
2008-04-25 18:45 UTC, Michael Natterer
committed Details | Review
updates to velocity (12.81 KB, patch)
2008-05-10 21:06 UTC, Alexia Death
none Details | Review
Revised patch for prevous updates. Makes cleaner blotch removal. (13.53 KB, patch)
2008-05-17 19:43 UTC, Alexia Death
none Details | Review
velocity fixes and random dynamic (46.84 KB, patch)
2008-05-21 20:19 UTC, Alexia Death
none Details | Review
velocity fixes and random dynamic update (47.40 KB, patch)
2008-05-21 20:58 UTC, Alexia Death
none Details | Review
velocity fixes and random dynamic update 2 (47.40 KB, patch)
2008-05-21 21:28 UTC, Alexia Death
committed Details | Review

Description Alexia Death 2008-04-22 20:37:45 UTC
This patch adds all the same functionality as pressure currently has to velocity parameter.
Comment 1 Alexia Death 2008-04-22 20:38:34 UTC
Created attachment 109722 [details] [review]
Velocity dynamics patch for paint tools.
Comment 2 Michael Natterer 2008-04-23 08:50:36 UTC
Created attachment 109748 [details] [review]
Cleaned up patch

- follows coding style
- fixes small bug in gimp_paintbrush_motion()
Comment 3 Michael Natterer 2008-04-25 18:45:30 UTC
Created attachment 109925 [details] [review]
Updated patch

Applies cleanly against trunk
Comment 4 Michael Natterer 2008-05-10 10:07:21 UTC
Modified the latest attached patch a bit again and comitted.
Leaving open because Alexia is about to upload another update.

2008-05-10  Michael Natterer  <mitch@gimp.org>

	Applied modified patch from Alexia Death which adds velocity
	support to paint tools in the spirit of the pressure support we
	already have. Fixes bug #529431.

	* app/display/gimpdisplayshell-coords.c
	(gimp_display_shell_eval_event): tweak velocity calculation to
	work in screen coordinates.

	* app/paint/gimppaintoptions.[ch]: add velocity options in the
	same way as there are pressure options. Add utility functions
	which return dynamic opatity and dynamic rate according to the the
	option's settings and some GimpCoords' pressure and velocity.

	* app/tools/gimppaintoptions-gui.c: add GUI for the velocity
	options.

	* app/paint/gimpbrushcore.h: remove PRESSURE_SCALE define, it's
	now in gimppaintoptions.h.

	* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
	inerpolate velocity too.

	(gimp_brush_core_calc_brush_scale): take velocity into account.

	(gimp_brush_core_get_brush_mask): always pressurize the mask in
	the GIMP_BRUSH_PRESSURE because there always is velocity (unlike
	pressure which is only there on tablets).

	* app/paint/gimpairbrush.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimpheal.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c: get opacity and rate from the new paint
	options utility functions which take both pressure and velocity
	into account.

	* app/paint/gimppaintbrush.c: take velocity into account when
	calculating the gradient color offset.

	* app/paint/gimpairbrush.c: do some additional fiddling with
	velocity in the asynchronous airbrush timeout.

	* app/paint/gimpairbrushoptions.c: override the velocity-size
	property and have it default to FALSE.
Comment 5 Alexia Death 2008-05-10 21:06:37 UTC
Created attachment 110696 [details] [review]
updates to velocity

gives airbrush sane defaults, stops brushes with velocity dependency from having these really ugly starting blobs(how is a bit ugly - but I failed to find a less ugly way...), consolidates event mixers to the paint options so adding dynamics can be done completely in one(well, two, because mouse button down stamping needs to get the carryover values for all non-direct dynamics...) place.
Comment 6 Alexia Death 2008-05-17 19:43:19 UTC
Created attachment 111069 [details] [review]
Revised patch for prevous updates. Makes  cleaner blotch removal.

To be applied after vector brushes fix.
Comment 7 Alexia Death 2008-05-21 20:19:05 UTC
Created attachment 111296 [details] [review]
velocity fixes and random dynamic

Again revised patch, additionally separates hardness calculation(broken in previous versions) and includes random dynamic, that touches all of the same code.

(sorry about piling...)
Comment 8 Alexia Death 2008-05-21 20:58:30 UTC
Created attachment 111299 [details] [review]
velocity fixes and random dynamic update

improved start conditions explanation and handling.
Comment 9 Alexia Death 2008-05-21 21:28:10 UTC
Created attachment 111302 [details] [review]
velocity fixes and random dynamic update 2

fixes bork airbrush options ui.
Comment 10 Michael Natterer 2008-05-22 16:39:24 UTC
Fixed in SVN:

2008-05-22  Michael Natterer  <mitch@gimp.org>

	Applied slightly modified and fixed patch from Alexia Death which
	adds a "random" axis to the paint dynamics and fixes some issues
	in the previous paint dynamics commits. Fixes bug #529431.

	* app/core/core-types.h: add a "random" axis to GimpCoords.

	* app/display/gimpdisplayshell-coords.c: set it to a random value.

	* app/display/gimpdisplayshell-callbacks.c: on button_press,
	use the dynamics from the last motion event to avoid blotches
	at the beginning of paint strokes.

	* app/paint/gimppaintoptions.[ch]: add random properties the same
	way we do pressure and velocity. Add get_dynamic_size(),
	get_dynamic_color() and get_dynamic_hardness() functions which
	look at all dynamic parameters of the passed coords.

	* app/tools/gimppaintoptions-gui.c: add gui for the random options.

	* app/paint/gimpbrushcore.[ch]: remove calc_brush_scale() and use
	gimp_paint_options_get_dynamic_size_instead().
	Add "dynamic_hardness" parameters to paste_canvas(),
	replace_canvas() and get_brush_mask().

	* app/paint/gimpairbrushoptions.c
	* app/paint/gimpclone.c
	* app/paint/gimpconvolve.c
	* app/paint/gimpdodgeburn.c
	* app/paint/gimperaser.c
	* app/paint/gimpheal.c
	* app/paint/gimppaintbrush.c
	* app/paint/gimpsmudge.c: calculate the dynamic hardness and pass
	it to above brush core functions. Use the get_dynamic_color() to
	calculate the gradient color.