Comparing version 3.0.0 to 3.0.1
@@ -65,5 +65,4 @@ /** @module gl-util/context */ | ||
else { | ||
var sb = scrollbar() | ||
w = window.innerWidth - sb[0] | ||
h = window.innerHeight - sb[1] | ||
w = window.innerWidth | ||
h = window.innerHeight | ||
} | ||
@@ -108,21 +107,1 @@ o.canvas.width = o.pixelRatio * w | ||
} | ||
function scrollbar () { | ||
const div = document.createElement('div') | ||
div.style.width = '100px' | ||
div.style.height = '100px' | ||
div.style.overflow = 'scroll' | ||
div.style.position = 'absolute' | ||
div.style.top = '-9999px' | ||
div.style.left = '-9999px' | ||
document.body.appendChild(div) | ||
const scrollbarWidth = div.offsetWidth - div.clientWidth | ||
const scrollbarHeight = div.offsetHeight - div.clientHeight | ||
document.body.removeChild(div) | ||
return [scrollbarWidth, scrollbarHeight] | ||
} |
{ | ||
"name": "gl-util", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Set of practical webgl utils", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,6 +6,7 @@ 'use strict' | ||
document.body.style.margin = 0 | ||
let gl = context({ | ||
attributes: {preserveDrawingBuffer: false} | ||
}) | ||
document.body.appendChild(gl.canvas) | ||
@@ -12,0 +13,0 @@ let attrs = gl.getContextAttributes(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29759
715