Assistant tool can't be used under a given size

Finally, I wasn’t able to wait this week-end to test…

So, first, I was wrong: file /krita/plugins/assistants/Assistants/kis_assistant_tool.cc define class to manage assistants, so, useless to solve my my problem…

Looking on other files, I found this in (most of) project() method implemented on assistants classes:
(Example from /krita/plugins/assistants/Assistants/VanishingPointAssistant.cc)

    qreal dx = pt.x() - strokeBegin.x();
    qreal dy = pt.y() - strokeBegin.y();

    if (dx * dx + dy * dy < 4.0) {
        // allow some movement before snapping
        return strokeBegin;
    }

Don’t really know why value of 4.0 has been fixed, but at this time if i change the value to 0.65, on a A4@600dpi document, line start to be drawn from 6pixels instead of 20pixels, that’s for me it much better (but i think 4px is my target :wink: )

I need to analyze this deeper but for me, the threshold should be defined according to:

  • The brush size: 6px for 2px brush size can be Ok, but for a 40px brush size it may doesn’t have sense
  • The current zoom: 6px on a 2000% zoom means a large movement and then, it could be interesting to have a threshold according to current zoom (ie: a number of pixels on screen instead of document)

I also understood (need to made some additional tests to confirm) why the number of pixels differs according to the document size:

  • When creating a document from template A4@600dpi, hey, we have 600dpi :slight_smile:
  • When creating manually a 1027x768 document, I was with a 120dpi resolution

So finally the threshold may also take in account the current document resolution…

Note: it seems that when project() method is called, the assistant has already been choose

Grum999