Streamline guide for line tool
ClosedPublic

Authored by abrahams on Mar 6 2016, 7:23 AM.

Details

Summary

This gives the line tool faster visual feedback, like the rectangle and
ellipse tools.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
abrahams updated this revision to Diff 2574.Mar 6 2016, 7:23 AM
abrahams retitled this revision from to Draw a one-pixel guide when using the line tool.
abrahams updated this object.
abrahams edited the test plan for this revision. (Show Details)
abrahams added a reviewer: Krita.

Hi, Michael!

There is already preview in the line tool. It should be activated by Checking a "preview" checkbox in the tool options. We can discuss making it default, but we need painters input there.

Or your patch does anything different?

abrahams updated this revision to Diff 2575.Mar 6 2016, 9:51 AM

Add code to make redraws prettier

abrahams updated this revision to Diff 2576.Mar 6 2016, 9:54 AM

Fix comment in stroke update compressor

abrahams updated this revision to Diff 2578.EditedMar 6 2016, 10:31 AM

Hi Dmitry - you're right, I missed the existing option for a guideline decoration, so I removed that from the patch.

This patch now consists of a different change which is to alter the brush engine preview - now it wipes that clean when the mouse is moved, and when the preview is turned on, it waits for the user to hover the mouse before drawing a preview.

The result is fewer stale lines on canvas. It also looks a lot nicer with the guideline turned on than it did previously.

I thought this justified changing the default to showing the guideline decoration.

Actually, we've discussed this in irc a few times, and we feel that the toggled preview line should be on by default and the stoke preview line should be the one toggled...

I'm perfectly ok with @woltherav's suggestions :)

abrahams updated this revision to Diff 2597.EditedMar 6 2016, 11:00 PM

This new version adds a toggle for the preview in addition to a toggle for the guideline. In other words, it is now possible to toggle each of them separately. The names are changed in the UI to reflect this distinction. The new default is to have both the preview and the guideline turned on.

abrahams retitled this revision from Draw a one-pixel guide when using the line tool to Streamline guide for line tool.Mar 6 2016, 11:01 PM

Anyone have a chance to review this?

what did you use to test on this? I am trying it with a mouse on my Windows 10 machine. The lines don't seem to be applying 90% of the time for some reason. I am on the krita-grids-kazakov branch, so maybe there is some weird conflict going on with that and all of the updated functionality he has.

dkazakov requested changes to this revision.Mar 10 2016, 8:26 AM
dkazakov added a reviewer: dkazakov.

Hi, @abrahams!

I have tested your patch. The idea of using clearPaint() + POSTPONE is nice and it make quite positive impression while using it.

There is only one critical bug present. When the mouse button is released, the stroke is not ended immediately, but is delayed. This make a really weird effect if you start painting the next stroke right after your previous stroke. Instead of starting a new line, the previous one will be modified.

Whwn the bug is fixed, I'm ok with pushing it into master.

plugins/tools/basictools/kis_tool_line.cc
113–117

Probably, rename it into "Show Preview" to keep it consistent with the other option?

This revision now requires changes to proceed.Mar 10 2016, 8:26 AM
abrahams updated this revision to Diff 2690.Mar 11 2016, 3:56 AM
abrahams edited edge metadata.

Terminate strokes correctly

abrahams marked an inline comment as done.Mar 11 2016, 3:58 AM

endStroke() was returning early because it expect a stroke to be in progress. I think this is fixed now.

abrahams updated this object.Mar 11 2016, 3:58 AM
abrahams edited edge metadata.
abrahams updated this revision to Diff 2691.Mar 11 2016, 5:18 AM

Don't draw updates for tiny movements

dkazakov accepted this revision.Mar 13 2016, 7:49 PM
dkazakov edited edge metadata.

Now works fine! Thank you very much! :)

This revision is now accepted and ready to land.Mar 13 2016, 7:49 PM
This revision was automatically updated to reflect the committed changes.