Bug 389034

Summary: Incorrect behavior when painting beyond the top or left borders of the canvas
Product: [Applications] krita Reporter: Nicholas LaPointe <nicholaslapointe8>
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: freebox64, halla
Priority: NOR Keywords: regression
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Example image
(Video example)

Description Nicholas LaPointe 2018-01-16 03:51:03 UTC
Created attachment 109899 [details]
Example image

Painting beyond the top or left borders of the canvas appears to produce a dashed version of what was drawn, with a 128px spacing.
This seems to have broken at or around the time that multithreaded brushes were added.

In the attached image, I drew lines that started on the canvas and ended outside of it, then moved the layer down and to the right.
Comment 1 mvowada 2018-01-16 11:08:17 UTC
Created attachment 109905 [details]
(Video example)

Yes, I can reproduce this bug on Ubuntu 14.04 with Krita 4.0.0-beta1.1 (OpenGL was enabled) (see video)
Comment 2 Halla Rempt 2018-01-17 11:02:30 UTC
One for Dmitry then. It is a regression, but I would not classify it as a release blocker.
Comment 3 Dmitry Kazakov 2018-02-06 14:05:08 UTC
Confirm, I can reproduce. It seem to be related to the new multithreaded pixel brush and the fact that the painting rectangles have negative offset
Comment 4 Dmitry Kazakov 2018-02-06 16:48:41 UTC
Git commit 18b549c1ee549b4be6182e368a42750adf56cce8 by Dmitry Kazakov.
Committed on 06/02/2018 at 16:48.
Pushed by dkazakov into branch 'master'.

Fix division in KisAlgebra2D::splitRectIntoPatches()

Here we should round the division result towards negative infinity
instead of zero point.

M  +19   -0    libs/global/kis_algebra_2d.h
M  +1    -1    libs/image/brushengine/kis_paintop_utils.cpp
M  +1    -1    libs/image/kis_painter.cc
M  +7    -4    libs/image/krita_utils.cpp
M  +23   -0    libs/image/tests/kis_algebra_2d_test.cpp
M  +2    -0    libs/image/tests/kis_algebra_2d_test.h

https://commits.kde.org/krita/18b549c1ee549b4be6182e368a42750adf56cce8