Closed sandeepnagra closed 6 years ago
That should not happen! Is yours a Retina display? (<-- I'm guessing this is at the heart of our issue.) Which browser/version is this? Can you provide the code? I can't do much more for you without this information.
I suggest you switch to using the base64_canvas
method until we can resolve this.
As I'm guessing our issue is about mis-identifying display resolution, its worth noting: The README says
macOS Retina
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 reasons I have not been more clear in the README are a) an accident (I updated the feature and forgot to update the README) and b) it can get pretty complicated: what happens on which browser/version can affect this, and things get very weird when you drag your window into different monitors.
I will file a bug to update the documentation, but at the moment I'm not entirely sure how to message what happens exactly, or even that my current approach is the best possible.
You are right @samnissen. The issue was due to multiple monitors. When I disconnect the second monitor and ran the test again, it came out fine.
So, I guess you can add a warning in README that multiple monitors can cause white spacing issue. BTW I am using a MAC and tested over Chrome 65.
Thanks for raising -- addressing this will be tracked in #25
Here's how it looks:
full-page-image.png