D15907: Compare float values in DecorationButton contains check
Roman Gilg
noreply at phabricator.kde.org
Tue Oct 2 21:06:22 BST 2018
romangg created this revision.
romangg added reviewers: KWin, zzag, davidedmundson.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
romangg requested review of this revision.
REVISION SUMMARY
In c9cfd840137b <https://phabricator.kde.org/R129:c9cfd840137b65bc7391f301f4f63da6df9de859> a position contains check was introduced in order to not count
a bottom or right edge position as being part of the DecorationButton like
QRectF::contains does.
This was done by converting the geometry to a QRect and using its contains
function, which does the comparision the desirable way for legacy reasons.
But this means we lose precision, since the decoration library in theory
supports floating values for positioning.
To not do this instead of using QRect's functionality and implicitly dropping
float precision therefore do the check for bottom and right edge explicitly.
TEST PLAN
Adapted autotest.
REPOSITORY
R129 Window Decoration Library
BRANCH
decorationContainsFix
REVISION DETAIL
https://phabricator.kde.org/D15907
AFFECTED FILES
autotests/decorationbuttontest.cpp
src/decorationbutton.cpp
To: romangg, #kwin, zzag, davidedmundson
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20181002/c0e06202/attachment.html>
More information about the Plasma-devel
mailing list