webgl-plot
Advanced tools
Comparing version 0.2.3 to 0.2.4
{ | ||
"name": "webgl-plot", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "High-performance 2D plotting framework based on native WebGL", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index", |
@@ -21,6 +21,6 @@ /** | ||
public scaleX: number; | ||
public scaleY: number; | ||
public offsetX: number; | ||
public offsetY: number; | ||
public gScaleX: number; | ||
public gScaleY: number; | ||
public gOffsetX: number; | ||
public gOffsetY: number; | ||
@@ -54,6 +54,6 @@ public lines: WebglBaseLine[]; | ||
this.scaleX = 1; | ||
this.scaleY = 1; | ||
this.offsetX = 0; | ||
this.offsetY = 0; | ||
this.gScaleX = 1; | ||
this.gScaleY = 1; | ||
this.gOffsetX = 0; | ||
this.gOffsetY = 0; | ||
@@ -87,6 +87,6 @@ this.backgroundColor = backgroundColor; | ||
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])); | ||
@@ -93,0 +93,0 @@ const uColor = webgl.getUniformLocation(line.prog, "uColor"); |
@@ -27,2 +27,7 @@ | ||
this.visible = true; | ||
this.scaleX = 1; | ||
this.scaleY = 1; | ||
this.offsetX = 0; | ||
this.offsetY = 0; | ||
} | ||
@@ -29,0 +34,0 @@ |
@@ -18,2 +18,7 @@ import {ColorRGBA} from "./ColorRGBA"; | ||
public scaleX: number; | ||
public scaleY: number; | ||
public offsetX: number; | ||
public offsetY: number; | ||
} |
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
470
30575
20