D15907: Compare float values in DecorationButton contains check

Roman Gilg noreply at phabricator.kde.org
Tue Oct 2 23:45:19 BST 2018


romangg added inline comments.

INLINE COMMENTS

> zzag wrote in decorationbutton.cpp:455
> Can you please explain this part? Shouldn't it be `d->geometry.right() < pos.x()`?

If `rect.width()` is smaller 0, then arbitrary QRect `rect` is to the left of its "anchor point" `rect.x()`. The right border is therefore defined by value `rect.x()`.

Looking at the Qt source in this case `rect.right()` defines the left border of the rectangle. I assume we always want to exclude the border to the right. I also hope that no on in practice defines a decoration button with negative width. ;)

REPOSITORY
  R129 Window Decoration Library

REVISION DETAIL
  https://phabricator.kde.org/D15907

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/3a960eab/attachment.html>


More information about the Plasma-devel mailing list