Skip to content

Commit

Permalink
Merge branch 'dev-2.0' into worldToScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
Garima3110 authored Oct 17, 2024
2 parents bd4a5a3 + ef1b09c commit 8163082
Show file tree
Hide file tree
Showing 85 changed files with 24,792 additions and 21,749 deletions.
48 changes: 24 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
*.DS_Store
.project
node_modules/*
experiments/*
lib_old/*
lib/p5.*
lib/modules
docs/reference/*
!*.gitkeep
examples/3d/
.idea
dist/
p5.zip
bower-repo/
p5-website/
.vscode/settings.json
.nyc_output/*
coverage/
lib/p5-test.js
release/
yarn.lock
docs/data.json
analyzer/
preview/
*.DS_Store
.project
node_modules/*
experiments/*
lib_old/*
lib/p5.*
lib/modules
docs/reference/*
!*.gitkeep
examples/3d/
.idea
dist/
p5.zip
bower-repo/
p5-website/
.vscode/settings.json
.nyc_output/*
coverage/
lib/p5-test.js
release/
yarn.lock
docs/data.json
analyzer/
preview/
__screenshots__/
90 changes: 67 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
},
"version": "1.9.4",
"dependencies": {
"acorn": "^8.12.1",
"acorn-walk": "^8.3.4",
"colorjs.io": "^0.5.2",
"file-saver": "^1.3.8",
"gifenc": "^1.0.3",
"libtess": "^1.2.2",
"omggif": "^1.0.10",
"opentype.js": "^1.3.1",
"zod-validation-error": "^3.3.1"
"opentype.js": "^1.3.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.7",
Expand Down Expand Up @@ -83,4 +84,4 @@
"pre-commit": "lint-staged"
}
}
}
}
47 changes: 25 additions & 22 deletions preview/index.html
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
<!DOCTYPE html>
<html>

<head>
<title>P5 test</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta charset="utf-8">

<style>
body{
margin:0;
overflow: hidden;
}
body {
margin: 0;
overflow: hidden;
}
</style>
</head>

<body>
<script type="module">
import p5 from '../src/app.js';
// import calculation from './src/math/calculation.js';
<script type="module">
import p5 from '../src/app.js';
// import calculation from './src/math/calculation.js';

// p5.registerAddon(calculation);
// p5.registerAddon(calculation);

const sketch = function(p){
p.setup = function(){
p.createCanvas(200, 200);
};
const sketch = function (p) {
p.setup = function () {
p.createCanvas(200, 200);
};

p.draw = function(){
p.background(0, 50, 50);
p.circle(100, 100, 50);
p.draw = function () {
p.background(0, 50, 50);
p.circle(100, 100, 50);

p.fill('white');
p.textSize(30);
p.text('hello', 10, 30);
};
};
p.fill('white');
p.textSize(30);
p.text('hello', 10, 30);
};
};

new p5(sketch);
</script>
new p5(sketch);
</script>
</body>

</html>
4 changes: 2 additions & 2 deletions src/accessibility/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ function outputs(p5, fn){
fn._getPos = function (x, y) {
const untransformedPosition = new DOMPointReadOnly(x, y);
const currentTransform = this._renderer.isP3D ?
new DOMMatrix(this._renderer.uMVMatrix.mat4) :
new DOMMatrix(this._renderer.states.uMVMatrix.mat4) :
this.drawingContext.getTransform();
const { x: transformedX, y: transformedY } = untransformedPosition
.matrixTransform(currentTransform);
Expand Down Expand Up @@ -663,7 +663,7 @@ function outputs(p5, fn){
];
// Apply the inverse of the current transformations to the canvas corners
const currentTransform = this._renderer.isP3D ?
new DOMMatrix(this._renderer.uMVMatrix.mat4) :
new DOMMatrix(this._renderer.states.uMVMatrix.mat4) :
this.drawingContext.getTransform();
const invertedTransform = currentTransform.inverse();
const tc = canvasCorners.map(
Expand Down
21 changes: 7 additions & 14 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ accessibility(p5);
import color from './color';
color(p5);

// core
// currently, it only contains the test for parameter validation
import friendlyErrors from './core/friendly_errors';
friendlyErrors(p5);

// data
import data from './data';
data(p5);
Expand Down Expand Up @@ -63,24 +68,12 @@ import utilities from './utilities';
utilities(p5);

// webgl
import './webgl/3d_primitives';
import './webgl/interaction';
import './webgl/light';
import './webgl/loading';
import './webgl/material';
import './webgl/p5.Camera';
import './webgl/p5.DataArray';
import './webgl/p5.Geometry';
import './webgl/p5.Matrix';
import './webgl/p5.Quat';
import webgl from './webgl';
webgl(p5);
import './webgl/p5.RendererGL.Immediate';
import './webgl/p5.RendererGL';
import './webgl/p5.RendererGL.Retained';
import './webgl/p5.Framebuffer';
import './webgl/p5.Shader';
import './webgl/p5.RenderBuffer';
import './webgl/p5.Texture';
import './webgl/text';

import './core/init';

Expand Down
Loading

0 comments on commit 8163082

Please sign in to comment.