webgl-plot
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -29,6 +29,6 @@ /** | ||
this.webgl = webgl; | ||
this.scaleX = 1; | ||
this.scaleY = 1; | ||
this.offsetX = 0; | ||
this.offsetY = 0; | ||
this.gScaleX = 1; | ||
this.gScaleY = 1; | ||
this.gOffsetX = 0; | ||
this.gOffsetY = 0; | ||
this.backgroundColor = backgroundColor; | ||
@@ -50,5 +50,5 @@ // Clear the canvas | ||
const uscale = webgl.getUniformLocation(line.prog, "uscale"); | ||
webgl.uniformMatrix2fv(uscale, false, new Float32Array([this.scaleX, 0, 0, this.scaleY])); | ||
webgl.uniformMatrix2fv(uscale, false, new Float32Array([line.scaleX * this.gScaleX, 0, 0, line.scaleY * this.gScaleY])); | ||
const uoffset = webgl.getUniformLocation(line.prog, "uoffset"); | ||
webgl.uniform2fv(uoffset, new Float32Array([this.offsetX, this.offsetY])); | ||
webgl.uniform2fv(uoffset, new Float32Array([line.offsetX + this.gOffsetX, line.offsetY + this.gOffsetY])); | ||
const uColor = webgl.getUniformLocation(line.prog, "uColor"); | ||
@@ -55,0 +55,0 @@ webgl.uniform4fv(uColor, [line.color.r, line.color.g, line.color.b, line.color.a]); |
@@ -14,2 +14,6 @@ import { WebglBaseLine } from "./WebglBaseLine"; | ||
this.visible = true; | ||
this.scaleX = 1; | ||
this.scaleY = 1; | ||
this.offsetX = 0; | ||
this.offsetY = 0; | ||
} | ||
@@ -16,0 +20,0 @@ setX(index, x) { |
{ | ||
"name": "webgl-plot", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "High-performance 2D plotting framework based on native WebGL", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
30972
474