Removing high-dpi check because it is not necessary anymore (and wrong implemented) #145
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the commit 2e2239e a fix for screens with 150% resolution (#81) was added:
leaflet.browser.print/src/leaflet.browser.print.sizes.js
Lines 126 to 131 in 2e2239e
With the V2 rewrite the logic was implemented wrong. Before the devicePixelRatio was added to the margin and subtracted from the size, now it is multipled with the size.
leaflet.browser.print/src/leaflet.browser.print.helpers.js
Lines 83 to 92 in 2378e6e
Which causes that for displays with 150% scale, the map is rendered on two pages:
Removing the devicePixelRatio fixes the issue:
I checked out the old commit 2e2239e to see for which reasons the devicePixelRatio was added but it looks like it was never necessary? Maybe the browsers have changed printing too
leaflet.browser.print/src/leaflet.browser.print.sizes.js
Lines 126 to 131 in 2e2239e
Here are images of the commit with and without devicePixelRatio:
With devicePixelRatio: smaller margin and additional content is on the first page:
Without devicePixelRatio the margins are equal:
@Igor-Vladyka are you able to find out if the changes of 2e2239e are still needed?