Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fragment-shader

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fragment-shader - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

classes/CodeEditor.ts

@@ -39,3 +39,3 @@ import { errorStyles } from '../util/editor';

export default class CodeEditor {
private config: EditorConfig;
public config: EditorConfig;
private state: EditorState;

@@ -42,0 +42,0 @@ private view: EditorView;

@@ -27,2 +27,3 @@ import { createShaderEditor } from '../util/editor';

this.onError = this.onError.bind(this);
this.onResize = this.onResize.bind(this);
this.editor = createShaderEditor({

@@ -32,3 +33,7 @@ ...this.config,

});
this.shader = new Shader({ ...this.config, onError: this.onError });
this.shader = new Shader({
...this.config,
onError: this.onError,
onResize: this.onResize,
});
}

@@ -46,2 +51,8 @@

onResize() {
this.editor.config.width = this.shader.config.width;
this.editor.config.height = this.shader.config.height;
this.editor.applyCSSVariables();
}
rebuild(config: { shader?: string; uniforms?: UniformValue[] } = {}) {

@@ -48,0 +59,0 @@ const {

@@ -35,2 +35,3 @@ import Uniform from './Uniform';

onSuccess: () => {},
onResize: () => {},
};

@@ -69,2 +70,4 @@

console.log(this.config);
this.state = {

@@ -171,2 +174,3 @@ active: false,

this.ctx?.viewport(0, 0, this.canvas.width, this.canvas.height);
this.config?.onResize?.();
}

@@ -265,2 +269,3 @@

this.ctx?.viewport(0, 0, this.canvas.width, this.canvas.height);
this.config?.onResize?.();
}

@@ -267,0 +272,0 @@

{
"name": "fragment-shader",
"version": "0.2.0",
"version": "0.2.1",
"description": "A lightweight, performant WebGL fragment shader renderer + editor. ",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -11,2 +11,3 @@ export interface ShaderConfig {

onError?: Function;
onResize?: Function;
animate?: boolean;

@@ -13,0 +14,0 @@ debug?: boolean;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc