figureone 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/figureone.min.js +1 -1
- package/index.js +16 -2
- package/package.json +1 -1
- package/types/js/figure/webgl/webgl.d.ts +1 -1
package/index.js
CHANGED
|
@@ -7878,6 +7878,9 @@ var GLObject = /*#__PURE__*/function (_DrawingObject) {
|
|
|
7878
7878
|
} else {
|
|
7879
7879
|
locations = webglInstance.useProgram(this.programIndex);
|
|
7880
7880
|
}
|
|
7881
|
+
if (!locations) {
|
|
7882
|
+
return;
|
|
7883
|
+
}
|
|
7881
7884
|
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
|
|
7882
7885
|
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
|
7883
7886
|
// gl.enable(gl.CULL_FACE);
|
|
@@ -34277,6 +34280,7 @@ var Figure = /*#__PURE__*/function () {
|
|
|
34277
34280
|
this.lostContextMessage.style.display = 'table';
|
|
34278
34281
|
this.elements.contextLost();
|
|
34279
34282
|
this.webglLow.contextLost();
|
|
34283
|
+
this.notifications.publish('contextLost');
|
|
34280
34284
|
}
|
|
34281
34285
|
}, {
|
|
34282
34286
|
key: "contextRestored",
|
|
@@ -34287,6 +34291,7 @@ var Figure = /*#__PURE__*/function () {
|
|
|
34287
34291
|
this.webglLow.recreateAtlases();
|
|
34288
34292
|
this.init(this.webglLow);
|
|
34289
34293
|
this.lostContextMessage.style.display = 'none';
|
|
34294
|
+
this.notifications.publish('contextRestored');
|
|
34290
34295
|
(0,_tools_tools__WEBPACK_IMPORTED_MODULE_7__.Console)('FigureOne context restored!');
|
|
34291
34296
|
}
|
|
34292
34297
|
}, {
|
|
@@ -64109,6 +64114,9 @@ function createProgram(gl, vertexShader, fragmentShader) {
|
|
|
64109
64114
|
}
|
|
64110
64115
|
function createShader(gl, type, source) {
|
|
64111
64116
|
var shader = gl.createShader(type);
|
|
64117
|
+
if (!shader) {
|
|
64118
|
+
return null;
|
|
64119
|
+
}
|
|
64112
64120
|
gl.shaderSource(shader, source);
|
|
64113
64121
|
gl.compileShader(shader);
|
|
64114
64122
|
var success = gl.getShaderParameter(shader, gl.COMPILE_STATUS);
|
|
@@ -64455,6 +64463,9 @@ var WebGLInstance = /*#__PURE__*/function () {
|
|
|
64455
64463
|
}
|
|
64456
64464
|
}
|
|
64457
64465
|
var newProgram = createProgramFromScripts(this.gl, shaders.vertexSource, shaders.fragmentSource);
|
|
64466
|
+
if (!newProgram) {
|
|
64467
|
+
return -1;
|
|
64468
|
+
}
|
|
64458
64469
|
var programDetails = {
|
|
64459
64470
|
vertexShader: {
|
|
64460
64471
|
src: shaders.vertexSource,
|
|
@@ -64478,6 +64489,9 @@ var WebGLInstance = /*#__PURE__*/function () {
|
|
|
64478
64489
|
key: "useProgram",
|
|
64479
64490
|
value: function useProgram(programIndex) {
|
|
64480
64491
|
var program = this.programs[programIndex];
|
|
64492
|
+
if (!program) {
|
|
64493
|
+
return null;
|
|
64494
|
+
}
|
|
64481
64495
|
if (this.lastUsedProgram !== program.program) {
|
|
64482
64496
|
this.gl.useProgram(program.program);
|
|
64483
64497
|
this.lastUsedProgram = program.program;
|
|
@@ -79073,8 +79087,8 @@ var tools = {
|
|
|
79073
79087
|
*/
|
|
79074
79088
|
|
|
79075
79089
|
var Fig = {
|
|
79076
|
-
version: "1.0.
|
|
79077
|
-
gitHash: "
|
|
79090
|
+
version: "1.0.3",
|
|
79091
|
+
gitHash: "70ef47765",
|
|
79078
79092
|
tools: tools,
|
|
79079
79093
|
Figure: _js_figure_Figure__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
79080
79094
|
Recorder: _js_figure_Recorder_Recorder__WEBPACK_IMPORTED_MODULE_7__.Recorder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "figureone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Draw, animate and interact with shapes, text, plots and equations in Javascript. Create interactive slide shows, and interactive videos.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -46,7 +46,7 @@ declare class WebGLInstance {
|
|
|
46
46
|
onLoad(id: string): void;
|
|
47
47
|
cancel(id: string): void;
|
|
48
48
|
getProgram(vertexShader: TypeVertexShader, fragmentShader: TypeFragmentShader): number;
|
|
49
|
-
useProgram(programIndex: number): Record<string, any
|
|
49
|
+
useProgram(programIndex: number): Record<string, any> | null;
|
|
50
50
|
constructor(canvas: HTMLCanvasElement, backgroundColor: Array<number>);
|
|
51
51
|
init(gl: WebGLRenderingContext): void;
|
|
52
52
|
resize(): void;
|