*** If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** SUMMARY When snap to grid is on, grid points which lie on the edge of the canvas do not get snapped to. STEPS TO REPRODUCE 1. Create a document of 300px x 300px 2. In "Grids and Guides" docker, set up a grid with x and y spacing set to 30px 3. Select the bezier curve tool 4. Try to click on a point where the horizontal and vertical grid lines intersect with the edge of the canvas. Notice how the tool does not snap to any grid points which are on the edge of the canvas. 1. 2. 3. OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
Sorry, I didn't see the extra fields! OBSERVED RESULT Bezier tool loosely snaps to the edge of the canvas instead of to the grid points that lie on the edge of the canvas. This means that points on the edge of the canvas do not align with the grid. EXPECTED RESULT Tapping a grid point on the edge of the canvas places the next bezier vertex exactly at the grid point. SOFTWARE/OS VERSIONS Windows: n/a macOS: n/a (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: n/a KDE Plasma Version: n/a KDE Frameworks Version: n/a Qt Version: n/a ADDITIONAL INFORMATION Reproduced on a Samsung Galaxy S8 Tab Ultra (Android)
Created attachment 173154 [details] screen recording of trying to use the bezier tool with snap to grid at the edge of the canvas
I can confirm that the "snap to grid" doesn't work for the grid points at the edge of the canvas. It does snap edge of the canvas but does not snap to the intersecting points. Seems to be reproducible on any edge of the canvas
Git commit 4009f8f911f6ec9006c4652eb029d3213df76a06 by Dmitry Kazakov. Committed on 15/11/2024 at 14:00. Pushed by dkazakov into branch 'krita/5.2'. Make sure that point-based snap points have higher priority than line-based ones Basically, if grid intersection lays near (or on the top of) the guide (or image bounds), then this intersection should have higher priority than snapping to a "mere" line. Ideally, we should make some clver resolver that can also find intersections between the different snap strategies, e.g. inteersection between a guide and a grid line. But it needs quite a lot of redesing in our snapping code, so we can postpone it now. M +1 -1 libs/basicflakes/tools/KoCreatePathTool_p.h M +9 -5 libs/flake/KoSnapGuide.cpp M +33 -16 libs/flake/KoSnapStrategy.cpp M +15 -2 libs/flake/KoSnapStrategy.h M +1 -1 libs/ui/canvas/KisSnapPixelStrategy.cpp M +1 -1 libs/ui/canvas/KisSnapPointStrategy.cpp M +4 -1 libs/ui/canvas/kis_snap_line_strategy.cpp https://invent.kde.org/graphics/krita/-/commit/4009f8f911f6ec9006c4652eb029d3213df76a06
Git commit f639df17feea76ff67985e96e4b6c517b969fb1a by Dmitry Kazakov. Committed on 15/11/2024 at 14:07. Pushed by dkazakov into branch 'master'. Make sure that point-based snap points have higher priority than line-based ones Basically, if grid intersection lays near (or on the top of) the guide (or image bounds), then this intersection should have higher priority than snapping to a "mere" line. Ideally, we should make some clver resolver that can also find intersections between the different snap strategies, e.g. inteersection between a guide and a grid line. But it needs quite a lot of redesing in our snapping code, so we can postpone it now. M +1 -1 libs/basicflakes/tools/KoCreatePathTool_p.h M +9 -5 libs/flake/KoSnapGuide.cpp M +33 -16 libs/flake/KoSnapStrategy.cpp M +15 -2 libs/flake/KoSnapStrategy.h M +1 -1 libs/ui/canvas/KisSnapPixelStrategy.cpp M +1 -1 libs/ui/canvas/KisSnapPointStrategy.cpp M +4 -1 libs/ui/canvas/kis_snap_line_strategy.cpp https://invent.kde.org/graphics/krita/-/commit/f639df17feea76ff67985e96e4b6c517b969fb1a