Skip to content

Commit 77eb865

Browse files
authored
Merge pull request #799 from atom-minimap/device-pixel-rounding
2 parents 1894eb5 + 990a7c0 commit 77eb865

File tree

4 files changed

+351
-247
lines changed

4 files changed

+351
-247
lines changed

lib/minimap.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,14 @@ export default class Minimap {
860860
* @returns {number} The devicePixelRatio in the Minimap
861861
*/
862862
getDevicePixelRatio() {
863-
return this.getDevicePixelRatioRounding() ? Math.floor(devicePixelRatio) : devicePixelRatio
863+
if (this.getDevicePixelRatioRounding()) {
864+
if (devicePixelRatio >= 1) {
865+
return Math.round(devicePixelRatio)
866+
} else {
867+
return Math.max(Math.round(devicePixelRatio * 10) / 10, 0.1)
868+
}
869+
}
870+
return devicePixelRatio
864871
}
865872

866873
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"eslint-config-atomic": "^1.16.1",
7878
"jasmine-expect": "^5.0.0",
7979
"npm-check-updates": "latest",
80-
"parcel": "^2.0.0-nightly.734",
80+
"parcel": "2.0.0-nightly.760",
8181
"prettier-config-atomic": "^2.0.5",
8282
"shx": "^0.3.3",
8383
"terser-config-atomic": "^0.1.1",

0 commit comments

Comments
 (0)