Skip to content

Commit

Permalink
2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Oct 22, 2024
1 parent 8920b43 commit d21eb82
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 86 deletions.
3 changes: 1 addition & 2 deletions home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ <h2 id="no-installation-required-💻">No Installation Required! 💻</h2>
<p>Use q5.js in your own project by adding this line to your HTML file:</p>
<pre><code class="language-html">&lt;script src="https://q5js.org/q5.js"&gt;&lt;/script&gt;
</code></pre>
<p>Full documentation is coming soon, for now see q5's <a href="https://github.com/q5js/q5.js" target="_blank">GitHub README</a>.</p>
</md>
<md id="md11-1">
<h2 id="join-our-community-🤝">Join our community 🤝</h2>
Expand All @@ -272,7 +271,7 @@ <h2 id="join-our-community-🤝">Join our community 🤝</h2>
<md id="md20-0">
<h2 id="credits-🌟">Credits 🌟</h2>
<p>This project aims to be the spiritual successor to the invaluable work done by <a href="https://benfry.com" target="_blank">Ben Fry</a> and <a href="https://x.com/REAS" target="_blank">Casey Reas</a> on Java <a href="https://processingfoundation.org/" target="_blank">Processing</a>, <a href="http://lauren-mccarthy.com" target="_blank">Lauren McCarthy</a>'s work on <a href="https://p5js.org" target="_blank">p5.js</a>, and all contributors to these projects.</p>
<p>The original <a href="https://github.com/LingDong-/q5xjs" target="_blank">q5xjs (v0)</a> was created by <a href="https://github.com/LingDong-" target="_blank">@LingDong~</a> and released under the public domain Unlicense license. We forked and significantly extended his brilliant codebase!</p>
<p>The original <a href="https://github.com/LingDong-/q5xjs" target="_blank">q5xjs (v0)</a> was created by <a href="https://github.com/LingDong-" target="_blank">@LingDong~</a> and released under the public domain Unlicense license. We forked and significantly extended his codebase.</p>
<p>q5.js v2 is open source under the LGPLv3, created and actively maintained by the q5 team: <a href="https://github.com/quinton-ashley" target="_blank">@quinton-ashley</a> and <a href="https://github.com/Tezumie" target="_blank">@Tezumie</a>.</p>
</md>
</div>
Expand Down
4 changes: 1 addition & 3 deletions lang/en/home/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ Use q5.js in your own project by adding this line to your HTML file:
<script src="https://q5js.org/q5.js"></script>
```

Full documentation is coming soon, for now see q5's [GitHub README](https://github.com/q5js/q5.js).

# 11-1

## Join our community 🤝
Expand All @@ -118,7 +116,7 @@ If you'd like to work on q5.js, check out our [Project Planning Board](https://g

This project aims to be the spiritual successor to the invaluable work done by [Ben Fry](https://benfry.com) and [Casey Reas](https://x.com/REAS) on Java [Processing](https://processingfoundation.org/), [Lauren McCarthy](http://lauren-mccarthy.com)'s work on [p5.js](https://p5js.org), and all contributors to these projects.

The original [q5xjs (v0)](https://github.com/LingDong-/q5xjs) was created by [@LingDong~](https://github.com/LingDong-) and released under the public domain Unlicense license. We forked and significantly extended his brilliant codebase!
The original [q5xjs (v0)](https://github.com/LingDong-/q5xjs) was created by [@LingDong~](https://github.com/LingDong-) and released under the public domain Unlicense license. We forked and significantly extended his codebase.

q5.js v2 is open source under the LGPLv3, created and actively maintained by the q5 team: [@quinton-ashley](https://github.com/quinton-ashley) and [@Tezumie](https://github.com/Tezumie).

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q5",
"version": "2.7.7",
"version": "2.8.0",
"description": "A sequel to p5.js that's optimized for interactive art",
"author": "quinton-ashley",
"contributors": [
Expand Down
60 changes: 21 additions & 39 deletions q5.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* q5.js
* @version 2.7
* @version 2.8
* @author quinton-ashley, Tezumie, and LingDong-
* @license LGPL-3.0
* @class Q5
Expand Down Expand Up @@ -890,20 +890,20 @@ Q5.renderers.q2d.drawing = ($) => {
} else $.ellipse(x, y, d, d);
};
$.point = (x, y) => {
if (x.x) {
y = x.y;
x = x.x;
}
if ($._da) {
x *= $._da;
y *= $._da;
if ($._doStroke) {
if (x.x) {
y = x.y;
x = x.x;
}
if ($._da) {
x *= $._da;
y *= $._da;
}
$.ctx.beginPath();
$.ctx.moveTo(x, y);
$.ctx.lineTo(x, y);
$.ctx.stroke();
}
$.ctx.save();
$.ctx.beginPath();
$.ctx.arc(x, y, $.ctx.lineWidth / 2, 0, $.TAU);
$.ctx.fillStyle = $.ctx.strokeStyle;
$.ctx.fill();
$.ctx.restore();
};
function rect(x, y, w, h) {
if ($._da) {
Expand Down Expand Up @@ -3748,29 +3748,6 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
vertIndex = i;
};

const addTri = (x1, y1, x2, y2, x3, y3, ci, ti) => {
let v = vertexStack,
i = vertIndex;

v[i++] = x1;
v[i++] = y1;
v[i++] = ci;
v[i++] = ti;

v[i++] = x2;
v[i++] = y2;
v[i++] = ci;
v[i++] = ti;

v[i++] = x3;
v[i++] = y3;
v[i++] = ci;
v[i++] = ti;

vertIndex = i;
drawStack.push(0, 3);
};

const addRect = (x1, y1, x2, y2, x3, y3, x4, y4, ci, ti) => {
let v = vertexStack,
i = vertIndex;
Expand Down Expand Up @@ -4043,11 +4020,16 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
$.vertex(x1, y1);
$.vertex(x2, y2);
$.vertex(x3, y3);
$.endShape();
$.endShape(true);
};

$.quad = (x1, y1, x2, y2, x3, y3, x4, y4) => {
addRect(x1, y1, x2, y2, x3, y3, x4, y4, $._fillIndex, $._transformIndex);
$.beginShape();
$.vertex(x1, y1);
$.vertex(x2, y2);
$.vertex(x3, y3);
$.vertex(x4, y4);
$.endShape(true);
};

$.background = (r, g, b, a) => {
Expand Down
4 changes: 2 additions & 2 deletions q5.min.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions src/q5-2d-drawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,20 @@ Q5.renderers.q2d.drawing = ($) => {
} else $.ellipse(x, y, d, d);
};
$.point = (x, y) => {
if (x.x) {
y = x.y;
x = x.x;
}
if ($._da) {
x *= $._da;
y *= $._da;
if ($._doStroke) {
if (x.x) {
y = x.y;
x = x.x;
}
if ($._da) {
x *= $._da;
y *= $._da;
}
$.ctx.beginPath();
$.ctx.moveTo(x, y);
$.ctx.lineTo(x, y);
$.ctx.stroke();
}
$.ctx.save();
$.ctx.beginPath();
$.ctx.arc(x, y, $.ctx.lineWidth / 2, 0, $.TAU);
$.ctx.fillStyle = $.ctx.strokeStyle;
$.ctx.fill();
$.ctx.restore();
};
function rect(x, y, w, h) {
if ($._da) {
Expand Down
2 changes: 1 addition & 1 deletion src/q5-core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* q5.js
* @version 2.7
* @version 2.8
* @author quinton-ashley, Tezumie, and LingDong-
* @license LGPL-3.0
* @class Q5
Expand Down
32 changes: 7 additions & 25 deletions src/q5-webgpu-drawing.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,6 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
vertIndex = i;
};

const addTri = (x1, y1, x2, y2, x3, y3, ci, ti) => {
let v = vertexStack,
i = vertIndex;

v[i++] = x1;
v[i++] = y1;
v[i++] = ci;
v[i++] = ti;

v[i++] = x2;
v[i++] = y2;
v[i++] = ci;
v[i++] = ti;

v[i++] = x3;
v[i++] = y3;
v[i++] = ci;
v[i++] = ti;

vertIndex = i;
drawStack.push(0, 3);
};

const addRect = (x1, y1, x2, y2, x3, y3, x4, y4, ci, ti) => {
let v = vertexStack,
i = vertIndex;
Expand Down Expand Up @@ -392,11 +369,16 @@ fn fragmentMain(@location(0) color: vec4f) -> @location(0) vec4f {
$.vertex(x1, y1);
$.vertex(x2, y2);
$.vertex(x3, y3);
$.endShape();
$.endShape(true);
};

$.quad = (x1, y1, x2, y2, x3, y3, x4, y4) => {
addRect(x1, y1, x2, y2, x3, y3, x4, y4, $._fillIndex, $._transformIndex);
$.beginShape();
$.vertex(x1, y1);
$.vertex(x2, y2);
$.vertex(x3, y3);
$.vertex(x4, y4);
$.endShape(true);
};

$.background = (r, g, b, a) => {
Expand Down

0 comments on commit d21eb82

Please sign in to comment.