Fix rubberband selection outline position
ClosedPublic

Authored by ndavis on Dec 14 2019, 7:07 PM.

Details

Summary

Before this patch, the outline of the rubberband selection control was down and to the right half a pixel too far.
This wasn't visible at 1x scaling because of the lack of antialiasing, but resulted in the top/left being too thin and bottom/right being too thick on high DPI displays.
To fix the issue, I enabled antialiasing and moved all sides inwards by half a pixel so that the outline would be pixel perfect.
I also added a function to get a QRectF with the correct size and position for rectangles with pen strokes.

Test Plan
  • Open dolphin and make a selection with the mouse
  • Go to a Folder View Plasma widget and make a selection with the mouse

2x scaling
before:


after:

3x scaling
before:


after:

Diff Detail

Repository
R31 Breeze
Branch
fix-rubberband (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19855
Build 19873: arc lint + arc unit
ndavis created this revision.Dec 14 2019, 7:07 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 14 2019, 7:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ndavis requested review of this revision.Dec 14 2019, 7:07 PM
ndavis edited the test plan for this revision. (Show Details)

@broulik Does this fix the problem for you?

ndavis edited the test plan for this revision. (Show Details)Dec 14 2019, 7:16 PM
ndavis edited the test plan for this revision. (Show Details)
hpereiradacosta accepted this revision.Dec 14 2019, 7:28 PM

Fix is legit. Thanks !
I would avoid changing the alpha of the color though because: it makes no difference, and it is unrelated to the issue. Should be a different commit (which you can do without review if you really think it is important)

Fix it then ship it !

This revision is now accepted and ready to land.Dec 14 2019, 7:28 PM

I would avoid changing the alpha of the color though because: it makes no difference, and it is unrelated to the issue. Should be a different commit (which you can do without review if you really think it is important)

It's not important, it's just nice if I can move it slightly up to an easy to express percentage (19.60784313725490% vs 20%)

ndavis updated this revision to Diff 71546.Dec 14 2019, 7:34 PM
ndavis edited the test plan for this revision. (Show Details)

Remove opacity change

ndavis updated this revision to Diff 71547.Dec 14 2019, 7:38 PM

fix code style

This revision was automatically updated to reflect the committed changes.