elementary / switchboard-plug-display

Switchboard Displays Plug
https://elementary.io
GNU General Public License v3.0
14 stars 18 forks source link

Fix visual 1px gaps #201

Closed felix-andreas closed 4 years ago

felix-andreas commented 4 years ago

When resizing the switchboard-plug-display the window, there is an occasional 1 pixel gap between display rectangles. This occurs if the fractional part of width * current_ratio times the number of monitors is greater than one. This happens because the integer cast always rounds down. I think this should be fixed by using Math.round. Still WIP.

kgrubb commented 4 years ago

I don't have more than 2 monitors to test this, but here's a quick gif using this branch:

ezgif com-optimize(2)

felix-andreas commented 4 years ago

@kgrubb Sry that I ask, but what do you want to show with this Gif?

This PR tries to fix the visual 1px gap between monitors mentioned in https://github.com/elementary/switchboard-plug-display/pull/183#pullrequestreview-292476030 and https://github.com/elementary/switchboard-plug-display/pull/184#pullrequestreview-305779103.

Before: gap Gap is between 2nd and 3rd monitor

After: nogaps

kgrubb commented 4 years ago

Ah ok, my bad! I wasn't sure if it affected 2-monitors, so I made a quick gif of the behavior just in case to confirm that there weren't any 1px gaps when using this branch.