Bug 381253 - "Edit Shapes Tool" not selecting segments sometimes (krita-4.0.0-prealpha appimage)
Summary: "Edit Shapes Tool" not selecting segments sometimes (krita-4.0.0-prealpha app...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Layers/Vector (other bugs)
Version First Reported In: 4.0 pre-alpha
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-15 22:20 UTC by mvowada
Modified: 2018-02-22 08:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Video example. (1.46 MB, video/mp4)
2017-06-15 22:20 UTC, mvowada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mvowada 2017-06-15 22:20:54 UTC
Created attachment 106121 [details]
Video example.

Sometimes the "Edit Shapes Tool" can't select "consecutive" vector segments (tested on Ubuntu 14.04 - krita-4.0.0-prealpha-x86_64.appimage).

Steps to reproduce:

1) keep deforming around the segments of a shape on vector layer.

Actual Results: at a certain point the "Edit Shapes Tool" fails to select some segments (please, see also the video in attachment).
Expected Results: always let to select the segments.
Comment 1 wolthera 2017-07-02 15:43:44 UTC
I get this a lot as well, and I suspect the corner cases are caused by symmetric nodes, as I do not get this issue when using the polyline shape and then deforming the nodes.
Comment 2 Dmitry Kazakov 2018-02-21 14:24:53 UTC
Okay, there are two problems:

1) Some segments are not recognized while mouse hovering (due to some maths problem)
2) The segment is selected, but the outline is not painted because the segment is out of shape bounds, therefore not updated. 

Without huge refactoring notes here [1], I can only fix the first problem :) 

[1] - https://phabricator.kde.org/T8021
Comment 4 Dmitry Kazakov 2018-02-22 08:40:02 UTC
Git commit b739d56cacaf50f3ff6234b75f7f2eb196249396 by Dmitry Kazakov.
Committed on 21/02/2018 at 15:15.
Pushed by dkazakov into branch 'master'.

Fix selection of path segments by clicking on them

There were two problems in segment selection algorithm:

1) It didn't use KoToolBase::handleGrabRect() for fetching grab
   distance, therefore it was not consistent with the distance
   we use for other actions.

2) KoPathSegment::nearestPoint() was filtering the final roots
   incorrectly. When searching for a point with nearest distance
   it was comparing the value with the **previous** point, but not
   the **minimal** one. Therefore, incorrect solution was returned.

M  +12   -12   libs/flake/KoPathSegment.cpp
M  +14   -14   libs/flake/tools/KoPathTool.cpp

https://commits.kde.org/krita/b739d56cacaf50f3ff6234b75f7f2eb196249396