Bug 377952

Summary: Assistant decorations are not updated when the brush outline is disabled
Product: [Applications] krita Reporter: flibbertigibbet007
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73, halla
Priority: NOR    
Version First Reported In: 3.1.2   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Snap to Assistant checkbox

Description flibbertigibbet007 2017-03-22 19:37:40 UTC
Assistant tool that follows the cursor does not draw elements.

It appears that the assistant tool lines are tied to a screen or canvas refresh. The refresh can be forced by changing focus of a layer, or by using the "brush preview" option on the cursor.

Using the "brush preview" option makes the assistant tool lines draw as the cursor moves.

With brush preview off, this problem can be seen by setting up a vanishing point assistant, going to the freehand brush tool and moving the cursor:

1) Set up a vanishing point assistant.
- click Assistant tool in toolbox docker
- choose Vanishing point in the drop down in tool options docker
- click two spots on or near the canvas
2) Use a freehand brush.
- click the Freehand Brush tool in the toolbox docker
3) move the cursor on the canvas
- notice lines are not following the cursor

With "Preview shape" selected in Settings > Configure Krita > General > Cursor Tab > Outline Shape, you will see the assistant lines following the cursor in step three above.
Comment 1 flibbertigibbet007 2017-03-22 19:55:22 UTC
Turning off OpenGL makes it worse. Only portions of the lines are drawn on screen, and causes artifacts to remain on screen.
Comment 2 Halla Rempt 2017-03-22 20:32:23 UTC
I guess you did not really test this bug on a representative set of Windows, OSX and Linux devices? So... What OS? What graphics card? What driver? If it's Linux, appimages or distribution builds?
Comment 3 flibbertigibbet007 2017-03-22 20:44:09 UTC
Tested on 

Asus Laptop with Nvidia GTX780m and Intel graphics (with Optimus)
Windows 10: (multiple recent driver versions)
Linux Ubuntu 16.10: Nouveau or Xorg driver (recent) 

Macbook Air mid2014 with intel graphics
OSX 10.12 : Intel (unknown driver version)

Thinkpad Laptop with Intel graphics
Linux Debian 3.16.36 : xorg driver (2:2.21.15)

All experienced the same issue.
Comment 4 flibbertigibbet007 2017-03-22 20:47:15 UTC
On linux only used the app image build 3.1.2 from the website. 
on OSX used the packaged version from the website.
Windows used the installer from the website.
Comment 5 flibbertigibbet007 2017-03-22 20:53:46 UTC
Also tried the same ubuntu linux install from the asus on the macbook by dual booting.
It may be an intel graphics issue. Since there is a commonality between all the devices. But I did try every OS.

I have a desktop machine at home I can try that is an Nvidia GTX 1080 dedicated card... and an Intel NUC machine that has another integrated intel graphics card.

I could boot up my old rig that has a dedicated Nvidia GTX 570ti to test too.

But those are at home, am at work at the moment.
Comment 6 flibbertigibbet007 2017-03-22 21:09:59 UTC
I don't believe that Krita has ever seen or "touched" the discrete nvidia card on the Asus machine, either in windows or in ubuntu due to the integrated graphics and the optimus capability. 

I don't believe Nvidia card actually ever worked in ubuntu, and I didn't notice any change when I tried to force the gpu in windows nvidia driver for krita.

So I will try on the computer with the dedicated nvidia cards to verify when I get home. The two desktops I have at home have windows 10 natively with nvidia gtx cards, but I can dualboot to a usb for ubuntu.
Comment 7 flibbertigibbet007 2017-03-23 00:31:33 UTC
Tested on Nvidia GTX 1080 computer windows 10 desktop. 

Exactly the same as all the others. Not an Intel graphics bug.

It may not be the screen or canvas refresh, rather a cursor location refresh? I don't know the code. Just trying to give some suggestions of where to look.

Assistant tool "preview" lines that follow the cursor (like vanishing point) do not refresh or draw when cursor outline option is "no outline". All other cursor outline options, the assistant tool preview lines show, and follows the cursor properly.
Comment 8 Dmitry Kazakov 2017-03-23 14:25:38 UTC
Hi, Flibbertigibbet!

Could you please check if you have Snap to Assistant checkbox set? I have just checked the work of the assistant on my computer and it works perfectly fine...
Comment 9 Dmitry Kazakov 2017-03-23 14:26:24 UTC
Created attachment 104698 [details]
Snap to Assistant checkbox

This one
Comment 10 flibbertigibbet007 2017-03-23 14:49:05 UTC
I see whats happening, you may be confused that I mean the assistant doesn't let *me* draw. I had to look up the meanings of the elements I'm talking about.

I mean the "preview lines" of the assistant don't draw or show on screen. Nothing to do with the tool locking or snapping to the assistant.

When you move the cursor the preview lines of the assistant tool should follow the cursor in real time. But without a cursor outline assigned the preview lines only show up when the screen or canvas is refreshed, like changing a layer or clicking on something else in the window or actually drawing on the canvas. 

The workaround is to have a cursor outline chosen. However this isn't a fix, because other tools that may rely on the assistant tool but don't have a cursor outline the preview lines won't follow the cursor.
Comment 11 flibbertigibbet007 2017-03-23 21:37:24 UTC
https://youtu.be/IWvH61Bfcjc

Created video to demonstrate the problem.
Comment 12 Dmitry Kazakov 2017-03-24 07:39:33 UTC
Ok, I got the problem now! Changing the bug to confirmed :)
Comment 13 Dmitry Kazakov 2017-04-11 11:02:21 UTC
Git commit 9eba0cd7d468ce94b250aa81a18e0738550c47fa by Dmitry Kazakov.
Committed on 11/04/2017 at 11:01.
Pushed by dkazakov into branch 'master'.

Fix updates of the assistants when the brush outline is disabled
Ref T5753

M  +3    -0    libs/ui/kis_painting_assistants_decoration.cpp
M  +21   -11   libs/ui/tool/kis_tool_paint.cc

https://commits.kde.org/krita/9eba0cd7d468ce94b250aa81a18e0738550c47fa
Comment 14 Dmitry Kazakov 2017-04-17 12:03:49 UTC
Git commit 9f365054eee16a8912900994d8907af8d604caa4 by Dmitry Kazakov.
Committed on 17/04/2017 at 11:39.
Pushed by dkazakov into branch 'krita/3.1'.

Fix updates of the assistants when the brush outline is disabled
Ref T5753

M  +3    -0    libs/ui/kis_painting_assistants_decoration.cpp
M  +21   -11   libs/ui/tool/kis_tool_paint.cc

https://commits.kde.org/krita/9f365054eee16a8912900994d8907af8d604caa4