Bug 321771 (Aiena)

Summary: Rotation issue with custom brushes
Product: [Applications] krita Reporter: aiena.krita
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
URL: https://www.dropbox.com/s/fssl3ice3bc6cng/rotation%20issue.jpg
Latest Commit: Version Fixed In:

Description aiena.krita 2013-06-29 17:08:45 UTC
I created a custom brush from an imager and then made a preset out of it.
I colsed krita and opened a new instance and reloaded the custom preset.

THe preset had rotation option enabled with rotation set to "drawing angle"

It rotates as expected with the exception of the starting point of the stroke and if the stroke is curved the ending point.




Reproducible: Always

Steps to Reproduce:
1. Create a custom brush from an image
2. Create a preset with rotation enabled
3. Draw on canvas with a pen.
Actual Results:  
the starting point is always random.

In the attached link I have posted an image describing the issue.

The blue annotations show the starting shape. All the strokes on the right hand side were straight strokes with the pen.

The stroke on the right is curved you can see the start and the end of that stroke is random.


Expected Results:  
The stroke should consistently rotate and start  with th beush not rotating randomly.

Additional info: 
OS: xubuntu raring 13.04 (64 bit with linux kernel 3.8.0-25)
Desktop environment: xfce 4.10
Tablet used: Wacom Bamboo pen fun and touch (touch functionality disabled)
Brush engine used: Pixel Brush
Comment 1 Halla Rempt 2013-07-20 11:03:44 UTC
Hi Aiena, 

Thanks for your report. Let's seen whether we can fix these issues together with some other of the rotation/mirror/angle issues of the brush engines... I'm not sure when we;ll get down to it, though.
Comment 2 Dmitry Kazakov 2013-08-03 20:45:13 UTC
Git commit 1da74f325476c83b7db60dd39d1ce108a9f4d1d5 by Dmitry Kazakov.
Committed on 03/08/2013 at 19:18.
Pushed by dkazakov into branch 'master'.

Fixed Speed, Distance and Drawing Angle sensors

This patch makes the following user-visible changes:

1) Speed and Distance sensors are fixed
2) Drawing Angle sensor became much more stable and smooth
3) Drawing Angle sensor works right on the rotated canvas

Technical details:

This patch hugely refactors the distance information part of
our painting system. The two most significant changes:

1) KisPaintInformation doesn't have movement() method, because it
   used to get inconsistent *very* fast when the lien was split into
   chunks in paintBezierCurve. The access to drawingDistance(),
   drawingAngle() and drawingSpeep() parameters is provided only by means
   of teh associated KisDistanceInformation.

2) (follows from the point 1) From now on paintAt() function also accepts
    KisDistanceInformation object, because otherwise it will not be able
    to access the calculated parameters.
Related: bug 308408, bug 279442

M  +3    -1    krita/benchmarks/kis_low_memory_benchmark.cpp
M  +25   -23   krita/benchmarks/kis_stroke_benchmark.cpp
M  +67   -30   krita/image/brushengine/kis_paint_information.cc
M  +27   -8    krita/image/brushengine/kis_paint_information.h
M  +34   -34   krita/image/brushengine/kis_paintop.cc
M  +18   -11   krita/image/brushengine/kis_paintop.h
M  +39   -10   krita/image/kis_distance_information.cpp
M  +11   -2    krita/image/kis_distance_information.h
M  +29   -0    krita/image/kis_global.h
M  +23   -23   krita/image/kis_painter.cc
M  +10   -9    krita/image/kis_painter.h
M  +4    -6    krita/image/recorder/kis_recorded_path_paint_action.cpp
M  +6    -4    krita/image/tests/kis_paint_information_test.cpp
M  +3    -7    krita/plugins/paintops/curvebrush/kis_curve_paintop.cpp
M  +1    -1    krita/plugins/paintops/curvebrush/kis_curve_paintop.h
M  +3    -4    krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
M  +1    -1    krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h
M  +6    -6    krita/plugins/paintops/dynadraw/kis_dyna_paintop.cpp
M  +1    -1    krita/plugins/paintops/dynadraw/kis_dyna_paintop.h
M  +3    -4    krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +1    -1    krita/plugins/paintops/experiment/kis_experiment_paintop.h
M  +3    -7    krita/plugins/paintops/hairy/kis_hairy_paintop.cpp
M  +1    -1    krita/plugins/paintops/hairy/kis_hairy_paintop.h
M  +1    -1    krita/plugins/paintops/libbrush/kis_auto_brush.cpp
M  +2    -2    krita/plugins/paintops/libbrush/kis_brush.cpp
M  +5    -11   krita/plugins/paintops/libbrush/kis_imagepipe_brush.cpp
M  +1    -2    krita/plugins/paintops/libbrush/tests/kis_auto_brush_test.cpp
M  +8    -16   krita/plugins/paintops/libbrush/tests/kis_brush_test.cpp
M  +3    -6    krita/plugins/paintops/libbrush/tests/kis_imagepipe_brush_test.cpp
M  +5    -0    krita/plugins/paintops/libpaintop/kis_dynamic_sensor.cc
M  +1    -0    krita/plugins/paintops/libpaintop/kis_dynamic_sensor.h
M  +5    -2    krita/plugins/paintops/libpaintop/kis_pressure_rotation_option.cpp
M  +6    -10   krita/plugins/paintops/libpaintop/kis_pressure_scatter_option.cpp
M  +9    -13   krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.cc
M  +1    -1    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_distance.h
M  +9    -2    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_list.cc
M  +2    -1    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensor_list.h
M  +22   -12   krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.cc
M  +1    -0    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.h
M  +8    -8    krita/plugins/paintops/libpaintop/tests/kis_sensors_test.cpp
M  +3    -6    krita/plugins/paintops/mypaint/mypaint_paintop.cpp
M  +1    -1    krita/plugins/paintops/mypaint/mypaint_paintop.h
M  +6    -7    krita/plugins/paintops/particle/kis_particle_paintop.cpp
M  +1    -1    krita/plugins/paintops/particle/kis_particle_paintop.h
M  +7    -8    krita/plugins/paintops/sketch/kis_sketch_paintop.cpp
M  +1    -1    krita/plugins/paintops/sketch/kis_sketch_paintop.h
M  +1    -1    krita/plugins/paintops/spray/spray_brush.cpp
M  +0    -2    krita/plugins/tools/defaulttools/kis_tool_line.cc
M  +3    -11   krita/ui/tool/kis_painting_information_builder.cpp
M  +0    -2    krita/ui/tool/kis_painting_information_builder.h
M  +2    -3    krita/ui/tool/kis_tool_freehand.cc
M  +24   -12   krita/ui/tool/kis_tool_freehand_helper.cpp
M  +3    -1    krita/ui/tool/kis_tool_freehand_helper.h
M  +6    -2    krita/ui/tool/kis_tool_multihand_helper.cpp
M  +3    -1    krita/ui/tool/kis_tool_multihand_helper.h
M  +7    -10   krita/ui/tool/strokes/freehand_stroke.cpp

http://commits.kde.org/calligra/1da74f325476c83b7db60dd39d1ce108a9f4d1d5