Skip to content

Commit 50e3c58

Browse files
authored
Merge branch 'processing:dev-2.0' into dev-2.0
2 parents 75f252a + 09eb345 commit 50e3c58

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1726
-1903
lines changed

docs/parameterData.json

Lines changed: 101 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@
197197
"colorMode": {
198198
"overloads": [
199199
[
200-
"RGB|HSB|HSL",
200+
"RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH",
201201
"Number?"
202202
],
203203
[
204-
"RGB|HSB|HSL",
204+
"RGB|HSB|HSL|RGBHDR|HWB|LAB|LCH|OKLAB|OKLCH",
205205
"Number",
206206
"Number",
207207
"Number",
@@ -401,7 +401,7 @@
401401
[
402402
"Number?",
403403
"Number?",
404-
"P2D|WEBGL?",
404+
"P2D|WEBGL|P2DHDR?",
405405
"HTMLCanvasElement?"
406406
],
407407
[
@@ -844,7 +844,7 @@
844844
"keyIsDown": {
845845
"overloads": [
846846
[
847-
"Number"
847+
"Number|String"
848848
]
849849
]
850850
},
@@ -1324,6 +1324,9 @@
13241324
"Number",
13251325
"Number",
13261326
"Number"
1327+
],
1328+
[
1329+
"p5.Vector"
13271330
]
13281331
]
13291332
},
@@ -2319,7 +2322,7 @@
23192322
"strokeMode": {
23202323
"overloads": [
23212324
[
2322-
"string"
2325+
"String"
23232326
]
23242327
]
23252328
},
@@ -2748,6 +2751,33 @@
27482751
]
27492752
]
27502753
},
2754+
"createModel": {
2755+
"overloads": [
2756+
[
2757+
"String",
2758+
"String?",
2759+
"Boolean",
2760+
"function(p5.Geometry)?",
2761+
"function(Event)?"
2762+
],
2763+
[
2764+
"String",
2765+
"String?",
2766+
"function(p5.Geometry)?",
2767+
"function(Event)?"
2768+
],
2769+
[
2770+
"String",
2771+
"String?",
2772+
"Object?",
2773+
"function(p5.Geometry)?",
2774+
"function(Event)?",
2775+
"boolean?",
2776+
"boolean?",
2777+
"boolean?"
2778+
]
2779+
]
2780+
},
27512781
"loadShader": {
27522782
"overloads": [
27532783
[
@@ -3361,6 +3391,46 @@
33613391
]
33623392
}
33633393
},
3394+
"p5.Geometry": {
3395+
"flipV": {
3396+
"overloads": [
3397+
[]
3398+
]
3399+
},
3400+
"calculateBoundingBox": {
3401+
"overloads": [
3402+
[]
3403+
]
3404+
},
3405+
"clearColors": {
3406+
"overloads": [
3407+
[]
3408+
]
3409+
},
3410+
"flipU": {
3411+
"overloads": [
3412+
[]
3413+
]
3414+
},
3415+
"computeFaces": {
3416+
"overloads": [
3417+
[]
3418+
]
3419+
},
3420+
"computeNormals": {
3421+
"overloads": [
3422+
[
3423+
"FLAT|SMOOTH?",
3424+
"Object?"
3425+
]
3426+
]
3427+
},
3428+
"normalize": {
3429+
"overloads": [
3430+
[]
3431+
]
3432+
}
3433+
},
33643434
"p5.Color": {
33653435
"toString": {
33663436
"overloads": [
@@ -3721,36 +3791,36 @@
37213791
"textBounds": {
37223792
"overloads": [
37233793
[
3724-
"string",
3725-
"number",
3726-
"number",
3727-
"number",
3728-
"number"
3794+
"String",
3795+
"Number",
3796+
"Number",
3797+
"Number",
3798+
"Number"
37293799
]
37303800
]
37313801
},
37323802
"fontBounds": {
37333803
"overloads": [
37343804
[
3735-
"string",
3736-
"number",
3737-
"number",
3738-
"number",
3739-
"number"
3805+
"String",
3806+
"Number",
3807+
"Number",
3808+
"Number",
3809+
"Number"
37403810
]
37413811
]
37423812
},
37433813
"textWidth": {
37443814
"overloads": [
37453815
[
3746-
"string"
3816+
"String"
37473817
]
37483818
]
37493819
},
37503820
"fontWidth": {
37513821
"overloads": [
37523822
[
3753-
"string"
3823+
"String"
37543824
]
37553825
]
37563826
},
@@ -3782,8 +3852,8 @@
37823852
"overloads": [
37833853
[
37843854
"p5.Font|string",
3785-
"number",
3786-
"object"
3855+
"Number",
3856+
"Object"
37873857
]
37883858
]
37893859
},
@@ -4200,15 +4270,15 @@
42004270
"getValue": {
42014271
"overloads": [
42024272
[
4203-
"number"
4273+
"Number"
42044274
]
42054275
]
42064276
},
42074277
"setValue": {
42084278
"overloads": [
42094279
[
4210-
"number",
4211-
"number"
4280+
"Number",
4281+
"Number"
42124282
]
42134283
]
42144284
},
@@ -4267,11 +4337,6 @@
42674337
},
42684338
"sub": {
42694339
"overloads": [
4270-
[
4271-
"Number",
4272-
"Number?",
4273-
"Number?"
4274-
],
42754340
[
42764341
"p5.Vector|Number[]"
42774342
],
@@ -4284,9 +4349,6 @@
42844349
},
42854350
"mult": {
42864351
"overloads": [
4287-
[
4288-
"Number"
4289-
],
42904352
[
42914353
"Number",
42924354
"Number",
@@ -4395,18 +4457,6 @@
43954457
]
43964458
]
43974459
},
4398-
"dist": {
4399-
"overloads": [
4400-
[
4401-
"p5.Vector"
4402-
],
4403-
[],
4404-
[
4405-
"p5.Vector",
4406-
"p5.Vector"
4407-
]
4408-
]
4409-
},
44104460
"normalize": {
44114461
"overloads": [
44124462
[],
@@ -4582,6 +4632,15 @@
45824632
"overloads": [
45834633
[]
45844634
]
4635+
},
4636+
"dist": {
4637+
"overloads": [
4638+
[],
4639+
[
4640+
"p5.Vector",
4641+
"p5.Vector"
4642+
]
4643+
]
45854644
}
45864645
},
45874646
"p5.Camera": {
@@ -4758,46 +4817,6 @@
47584817
]
47594818
}
47604819
},
4761-
"p5.Geometry": {
4762-
"calculateBoundingBox": {
4763-
"overloads": [
4764-
[]
4765-
]
4766-
},
4767-
"clearColors": {
4768-
"overloads": [
4769-
[]
4770-
]
4771-
},
4772-
"flipU": {
4773-
"overloads": [
4774-
[]
4775-
]
4776-
},
4777-
"flipV": {
4778-
"overloads": [
4779-
[]
4780-
]
4781-
},
4782-
"computeFaces": {
4783-
"overloads": [
4784-
[]
4785-
]
4786-
},
4787-
"computeNormals": {
4788-
"overloads": [
4789-
[
4790-
"FLAT|SMOOTH?",
4791-
"Object?"
4792-
]
4793-
]
4794-
},
4795-
"normalize": {
4796-
"overloads": [
4797-
[]
4798-
]
4799-
}
4800-
},
48014820
"p5.Shader": {
48024821
"version": {
48034822
"overloads": [

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"node ./utils/sample-linter.mjs"
2323
]
2424
},
25-
"version": "2.0.0-beta.2",
25+
"version": "2.0.0-beta.3",
2626
"dependencies": {
2727
"@davepagurek/bezier-path": "^0.0.2",
2828
"acorn": "^8.12.1",

preview/index.html

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,27 @@
2020
import p5 from '../src/app.js';
2121

2222
const sketch = function (p) {
23+
let fbo;
2324
p.setup = async function () {
24-
p.createCanvas(400, 400);
25+
p.createCanvas(400, 400, p.WEBGL);
26+
fbo = p.createFramebuffer()
2527
};
2628

2729
p.draw = function () {
30+
p.push();
2831
p.background(200);
32+
fbo.begin()
33+
p.background('blue')
2934
p.strokeWeight(10);
35+
p.push()
36+
p.stroke('red')
3037
p.line(-100, -100, 100, 100);
38+
p.pop()
39+
p.translate(200, 200)
40+
p.line(-100, -100, 100, 100);
41+
fbo.end()
42+
p.image(fbo, 0, 0)
43+
p.pop();
3144
};
3245
};
3346

src/accessibility/outputs.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -540,14 +540,9 @@ function outputs(p5, fn){
540540

541541
//gets position of shape in the canvas
542542
fn._getPos = function (x, y) {
543-
const untransformedPosition = new DOMPointReadOnly(x, y);
544-
const currentTransform = this._renderer.isP3D ?
545-
new DOMMatrix(this._renderer.calculateCombinedMatrix()) :
546-
this.drawingContext.getTransform();
547-
const { x: transformedX, y: transformedY } = untransformedPosition
548-
.matrixTransform(currentTransform);
549-
const canvasWidth = this.width * this._renderer._pixelDensity;
550-
const canvasHeight = this.height * this._renderer._pixelDensity;
543+
const { x: transformedX, y: transformedY } = this.worldToScreen(new this.Vector(x, y));
544+
const canvasWidth = this.width;
545+
const canvasHeight = this.height;
551546
if (transformedX < 0.4 * canvasWidth) {
552547
if (transformedY < 0.4 * canvasHeight) {
553548
return 'top left';

0 commit comments

Comments
 (0)