watir-screenshot-stitch assumes any user running macOS is displaying at 'Retina' resolution, therefore multiplies all screen resolutions by 2. Any other operating system will not trigger this multiplication.
But that's not technically true -- the gem tries to determine your screen resolution:
def retina?
payload = %{var mq = window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)"); return (mq && mq.matches || (window.devicePixelRatio > 1));}
@browser.execute_script payload
end
The README should be updated to at least reflect the new detection strategy. Ideally, it would also note the dependence on the CSS selectors of the browser being driven, and note that odd behavior can result when viewports are resized or moved into different monitors.
As mentioned in #24:
The README says
But that's not technically true -- the gem tries to determine your screen resolution:
The README should be updated to at least reflect the new detection strategy. Ideally, it would also note the dependence on the CSS selectors of the browser being driven, and note that odd behavior can result when viewports are resized or moved into different monitors.