bugfix for krita bug 402535
ClosedPublic

Authored by pavelb on Jan 7 2019, 12:02 AM.

Details

Reviewers
rempt
Group Reviewers
Krita
Summary

A part of Krita assistants' protocol is that the method adjustPosition(QPointF, QPointF) of an assistant can return (NaN, NaN) as a valid value, indicating that the assistant doesn't want to participate in the process of adjusting input. The KisPaintingAssistantsDecoration::adjustPosition(const QPointF&, const QPointF&) function, in turn, should either choose another assistant, if there is any, or return the position unchanged back to the caller. However, there is a case where this method doesn't check for NaN value, which then propagated all the way to the painting engine, resulting in the bug 402535.

This diff fixes the special case and so ensures that (NaN, NaN) is never returned by KisPaintingAssistantsDecoration::adjustPosition.

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
pavelb created this revision.Jan 7 2019, 12:02 AM
Restricted Application added a reviewer: Krita. · View Herald TranscriptJan 7 2019, 12:02 AM
pavelb requested review of this revision.Jan 7 2019, 12:02 AM
rempt added a subscriber: rempt.Jan 7 2019, 10:28 AM

Thanks for the investigation and the patch! I've got one question, though...

libs/ui/kis_painting_assistants_decoration.cpp
171

Wouldn't it be better to use qIsNaNPoint here?

it's your call i guess... I just copied the same approach as one that already exists in this member function(compare to lines 157, 145, 134)

libs/ui/kis_painting_assistants_decoration.cpp
171

it's your call i guess... I just copied the same approach as one that already exists in this member function(compare to lines 157, 145, 134)

rempt added a comment.Jan 7 2019, 10:59 AM

Right... Let's push this patch first, then fix to use qIsNanPoint (which isn't, apparently a Qt function as I originally thought, but something home-grown in the KOffice era).

rempt accepted this revision.Jan 7 2019, 10:59 AM

Oh -- have you got push access, or should we push this for you?

This revision is now accepted and ready to land.Jan 7 2019, 10:59 AM
pavelb added a comment.EditedJan 7 2019, 11:03 AM

I dont think i have push access. I only downloaded and looked at sources to fix this bug since Saturday:)

ps thanks to krita irc channel for helping me with all of this

Then we'll push for you, git --author requires first and lastname and an email, how would you like to be known?

pavel belski, genosimple at gmail d com

rempt closed this revision.Jan 7 2019, 11:11 AM