[effects/slidingpopups] Simplify math in setupAnimData
ClosedPublic

Authored by zzag on Jul 13 2018, 7:12 AM.

Details

Summary

Also, this change fixes "possible bug" when sanitizing offset for
East/South(Right/Bottom) location.

QHash abuse will be fixed in the follow-up patches.

Diff Detail

Repository
R108 KWin
Branch
effects-slidingpopups-overhaul
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 804
Build 817: arc lint + arc unit
zzag created this revision.Jul 13 2018, 7:12 AM
Restricted Application added a project: KWin. · View Herald TranscriptJul 13 2018, 7:12 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jul 13 2018, 7:12 AM
davidedmundson added inline comments.
effects/slidingpopups/slidingpopups.cpp
445

Careful.
QRect::right is completely insane and is not the same as left+width

I think in this case the brokenness cancels out, but make sure you're aware of this trap when porting code.

zzag added inline comments.Jul 13 2018, 7:41 AM
effects/slidingpopups/slidingpopups.cpp
445

Yes, I'm totally aware of this. :-)

And, yeah, you're right, '-1's cancel each other in this case.

davidedmundson accepted this revision.Jul 13 2018, 10:51 AM
This revision is now accepted and ready to land.Jul 13 2018, 10:51 AM
This revision was automatically updated to reflect the committed changes.