Skip to content

Commit 96e61ee

Browse files
committed
apply pixelRatio in lineWidths
1 parent 1f84f76 commit 96e61ee

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

surface.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function drawCore (params, transparent) {
391391
// Draw contour levels
392392
for (i = 0; i < 3; ++i) {
393393
shader.uniforms.permutation = PERMUTATIONS[i]
394-
gl.lineWidth(this.contourWidth[i])
394+
gl.lineWidth(this.contourWidth[i] * this.pixelRatio)
395395

396396
for (j = 0; j < this.contourLevels[i].length; ++j) {
397397
if (j === this.highlightLevel[i]) {
@@ -420,7 +420,7 @@ function drawCore (params, transparent) {
420420
continue
421421
}
422422
shader.uniforms.permutation = PERMUTATIONS[j]
423-
gl.lineWidth(this.contourWidth[j])
423+
gl.lineWidth(this.contourWidth[j] * this.pixelRatio)
424424
for (var k = 0; k < this.contourLevels[j].length; ++k) {
425425
if (k === this.highlightLevel[j]) {
426426
shader.uniforms.contourColor = this.highlightColor[j]
@@ -450,7 +450,7 @@ function drawCore (params, transparent) {
450450
shader.uniforms.model = uniforms.model
451451
shader.uniforms.clipBounds = uniforms.clipBounds
452452
shader.uniforms.permutation = PERMUTATIONS[i]
453-
gl.lineWidth(this.dynamicWidth[i])
453+
gl.lineWidth(this.dynamicWidth[i] * this.pixelRatio)
454454

455455
shader.uniforms.contourColor = this.dynamicColor[i]
456456
shader.uniforms.contourTint = this.dynamicTint[i]
@@ -555,7 +555,7 @@ proto.drawPick = function (params) {
555555
vao.bind()
556556

557557
for (j = 0; j < 3; ++j) {
558-
gl.lineWidth(this.contourWidth[j])
558+
gl.lineWidth(this.contourWidth[j] * this.pixelRatio)
559559
shader.uniforms.permutation = PERMUTATIONS[j]
560560
for (i = 0; i < this.contourLevels[j].length; ++i) {
561561
if (this._contourCounts[j][i]) {
@@ -1272,6 +1272,7 @@ proto.highlight = function (selection) {
12721272

12731273
function createSurfacePlot (params) {
12741274
var gl = params.gl
1275+
12751276
var shader = createShader(gl)
12761277
var pickShader = createPickShader(gl)
12771278
var contourShader = createContourShader(gl)

0 commit comments

Comments
 (0)