Skip to content

Commit

Permalink
2.11.7
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Nov 29, 2024
1 parent a1be464 commit 5220c5a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@q5/q5",
"version": "2.11.6",
"version": "2.11.7",
"license": "LGPL-3.0",
"description": "A sequel to p5.js that's optimized for interactive art",
"author": "quinton-ashley",
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.11.6",
"version": "2.11.7",
"description": "A sequel to p5.js that's optimized for interactive art",
"author": "quinton-ashley",
"contributors": [
Expand Down
6 changes: 3 additions & 3 deletions q5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1314,8 +1314,8 @@ function setup() {

/** 🌆
* Creates a new image.
* @param {number} w - width
* @param {number} h - height
* @param {number} [w] - character limit per line
* @param {number} [h] - line limit
* @param {any} [opt] - optional settings for the image
* @returns {Image}
*/
Expand Down Expand Up @@ -1345,7 +1345,7 @@ textSize(20);
let info = "q5.js is a JavaScript library for creative coding. It's a sequel to p5.js that's optimized for interactive art.";
text(info, 12, 30, 20, 5);
text(info, 12, 30, 20, 6);
*/
function text(str: string, x: number, y: number, w?: number, h?: number): void;

Expand Down
4 changes: 2 additions & 2 deletions q5.js
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ Q5.renderers.q2d.text = ($, q) => {
if ($._doFill) ctx.fillText(line, tX, tY);
tY += leading;
lineAmount++;
if (lineAmount > h) break;
if (lineAmount >= h) break;
}
lines.length = 0;

Expand Down Expand Up @@ -5274,7 +5274,7 @@ fn fragmentMain(input : VertexOutput) -> @location(0) vec4f {
if (str.length > w) {
let wrapped = [];
let i = 0;
while (i < str.length) {
while (i < str.length && wrapped.length < h) {
let max = i + w;
if (max >= str.length) {
wrapped.push(str.slice(i));
Expand Down
2 changes: 1 addition & 1 deletion q5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/q5-2d-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Q5.renderers.q2d.text = ($, q) => {
if ($._doFill) ctx.fillText(line, tX, tY);
tY += leading;
lineAmount++;
if (lineAmount > h) break;
if (lineAmount >= h) break;
}
lines.length = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/q5-webgpu-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ fn fragmentMain(input : VertexOutput) -> @location(0) vec4f {
if (str.length > w) {
let wrapped = [];
let i = 0;
while (i < str.length) {
while (i < str.length && wrapped.length < h) {
let max = i + w;
if (max >= str.length) {
wrapped.push(str.slice(i));
Expand Down

0 comments on commit 5220c5a

Please sign in to comment.