New issue
Advanced search Search tips

Issue 841532 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

Refresh tabs have gaps at HiDPI

Project Member Reported by bsep@chromium.org, May 9 2018

Issue description

At 150% scaling there are some 1 pixel gaps between tabs, screenshot attached. Obviously if the background color is the same as the inactive tab color you can't tell, so you need to enable "Show color on title bar" in Settings>Personalization>Colors too.
 
refresh-tab-hidpi.PNG
2.5 KB View Download
Cc: bsep@chromium.org
I found a positioning bug with the separator. A CL is landing that fixes it. Let me know if that also fixes this issue.

Comment 2 by bsep@chromium.org, May 14 2018

Still happening on latest Canary. I just noticed if I resize the browser up and down the gaps flicker in an out, which is maybe a clue.
hidpi-dividers.PNG
149 KB View Download
Reproducing this, not every pair of tabs have a gap. If the vertical edge of the tab lands between pixel boundaries, antialiasing could leak the background color slightly. For non integral scales, this can happen very easily.

Here I see the gap between the tab in the middle and the one on the right, but not between the one on the left and the middle one.

This is at a forced scale factor of 1.5x. Just looking at the arcs between the tabs along the top, you can see how one is blending better in the valley between the two.

Other than forcing the left or right tab edge to land on a pixel boundary, I'm not sure how to fix this.
TabGap1.5Scale.png
11.3 KB View Download
Here's my proposed fix to how the Tab path computation functions need to change to get drawing here correct.

Assuming tabstrip starts on an integral pixel (if not, need to guarantee this some other way):
* Get Tab bounds() (e.g. pass in the bounds() instead of the current size)
* Convert to layout bounds
* Scale both true and layout bounds up by scale factor to convert DIPs to px
* Snap horizontal edges of layout bounds to integral pixels
* Compute scaled outer curve radii
* Clamp (snapped layout bounds + scaled outer curves) to (scaled true bounds)
* Offset everything by -origin of scaled true bounds to convert back to local coordinates (can be done before or after drawing path, just depends how you want to write the code)

One way that might make this easier to implement is to ensure all the path segment additions use relative positioning instead of absolute; then there's no need to stick "left" and "top" variables in everywhere.  ("right" and "bottom" in this case would need to be "width" and "height".)
Here's what it looks like with the tab verticals aligned on a pixel boundary. The gap is clearly gone. However it now clips the separator in some instances. That will also need to be pixel aligned in the same way. Because Dips. Ugh.
TabPixelAlignment.png
6.4 KB View Download
Status: Fixed (was: Assigned)

Sign in to add a comment