[effects/magnifier] Fix 1 px gap between magnified area and frame
ClosedPublic

Authored by zzag on Sep 4 2018, 5:46 PM.

Details

Summary

We have to adjust only QRect::right and QRect::bottom, QRect::left and QRect::top are okay.

Test Plan

Before:

After:

Diff Detail

Repository
R108 KWin
Branch
effects-magnifier-fix-1px-gaps
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2501
Build 2519: arc lint + arc unit
zzag created this revision.Sep 4 2018, 5:46 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 4 2018, 5:46 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Sep 4 2018, 5:46 PM
zzag planned changes to this revision.EditedSep 4 2018, 5:52 PM

Right and bottom still need to have +1 offsets.

zzag updated this revision to Diff 41000.Sep 4 2018, 6:09 PM

Adjust only QRect::right and QRect::bottom

zzag edited the summary of this revision. (Show Details)Sep 4 2018, 6:10 PM
zzag edited the test plan for this revision. (Show Details)
davidedmundson accepted this revision.Sep 10 2018, 9:02 AM
davidedmundson added a subscriber: davidedmundson.

As you're doing the common fix for QRect::right/bottom fix would it be cleaner to just use a QRectF for the area and then kill all the +1s?

This revision is now accepted and ready to land.Sep 10 2018, 9:02 AM
zzag added a comment.Sep 10 2018, 9:29 AM

As you're doing the common fix for QRect::right/bottom fix would it be cleaner to just use a QRectF for the area and then kill all the +1s?

Yes, it would. But then we would mix QRectF's and QRect's. Nah, that's a can of worms. Can we push it as it is right now(this diff pretty much corrects existing calculations) and revisit this in the future?

I struggle to see how

QRectF areaF = area;
inside the one block where we make the vertices is a "can of worms". It's scarcely even one worm.

but you have this approved, do whichever.

zzag added a comment.Sep 10 2018, 9:54 AM

I struggle to see how

QRectF areaF = area;
inside the one block where we make the vertices is a "can of worms". It's scarcely even one worm.

but you have this approved, do whichever.

Well, we have area and areaF, which is not really clean. It would be cleaner to use type of QRectF for area, but then things become ugly. Anyway, I'll do your way.

zzag updated this revision to Diff 41325.Sep 10 2018, 10:02 AM

Use QRectF

davidedmundson accepted this revision.Sep 10 2018, 10:03 AM
zzag added a comment.Sep 10 2018, 10:06 AM

I'll adjust the commit message on push.

This revision was automatically updated to reflect the committed changes.