From 46b8de48e560b1452eba9249babd622f5af856a5 Mon Sep 17 00:00:00 2001 From: Aditya Chaudhary Date: Sat, 1 Feb 2025 11:41:22 +0530 Subject: [PATCH 01/11] Fixed getVertexCount() method issue of giving output 0 for GROUP shape by Updating it in PShape & PShapeOpenGL class --- core/src/processing/core/PShape.java | 2 +- core/src/processing/opengl/PShapeOpenGL.java | 22 +++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 0538cb761..da2af3a90 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -2346,7 +2346,7 @@ public class PShape implements PConstants { * @see PShape#setVertex(int, float, float) */ public int getVertexCount() { - if (family == GROUP || family == PRIMITIVE) { + if (family == PRIMITIVE) { PGraphics.showWarning(NO_VERTICES_ERROR); } return vertexCount; diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index 810cbab70..c611b6afa 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -1635,17 +1635,23 @@ public class PShapeOpenGL extends PShape { @Override public int getVertexCount() { - if (family == GROUP) return 0; // Group shapes don't have vertices - else { + int count = 0; + // If the shape is a group, recursively count the vertices of its children + if (family == GROUP) { + // Iterate through all the child shapes and count their vertices + for (int i = 0; i < getChildCount(); i++) { + count += getChild(i).getVertexCount(); // Recursive call to get the vertex count of child shapes + } + } else { if (root.tessUpdate) { if (root.tessKind == TRIANGLES) { - return lastPolyVertex - firstPolyVertex + 1; + count += lastPolyVertex - firstPolyVertex + 1; } else if (root.tessKind == LINES) { - return lastLineVertex - firstLineVertex + 1; + count += lastLineVertex - firstLineVertex + 1; } else if (root.tessKind == POINTS) { - return lastPointVertex - firstPointVertex + 1; + count += lastPointVertex - firstPointVertex + 1; } else { - return 0; + count += 0; // Handle other cases } } else { if (family == PRIMITIVE || family == PATH) { @@ -1653,12 +1659,14 @@ public class PShapeOpenGL extends PShape { // tessellation updateTessellation(); } - return inGeo.vertexCount; + count += inGeo.vertexCount; } } + return count; } + @Override public PVector getVertex(int index, PVector vec) { if (vec == null) vec = new PVector(); From 93d2f933791876d985566f613e0b0f40250b455c Mon Sep 17 00:00:00 2001 From: Aditya Chaudhary Date: Tue, 4 Feb 2025 01:11:09 +0530 Subject: [PATCH 02/11] Fixed issue : Updated the getVertexCount() to take optional boolean value to count children --- core/src/processing/core/PShape.java | 12 +++++++++++- core/src/processing/opengl/PShapeOpenGL.java | 13 ++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index da2af3a90..27c66b472 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -2345,8 +2345,18 @@ public class PShape implements PConstants { * @see PShape#getVertex(int) * @see PShape#setVertex(int, float, float) */ + public int getVertexCount(boolean includeChildren) { + if(!includeChildren && family == GROUP){ + PGraphics.showWarning(NO_VERTICES_ERROR); + } + else if (family == PRIMITIVE) { + PGraphics.showWarning(NO_VERTICES_ERROR); + } + return vertexCount; + } + public int getVertexCount() { - if (family == PRIMITIVE) { + if(family == GROUP || family == PRIMITIVE){ PGraphics.showWarning(NO_VERTICES_ERROR); } return vertexCount; diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/core/src/processing/opengl/PShapeOpenGL.java index c611b6afa..f34031f1a 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/core/src/processing/opengl/PShapeOpenGL.java @@ -1632,15 +1632,23 @@ public class PShapeOpenGL extends PShape { // Setters/getters of individual vertices - + //for taking the default value as false , so user don't have to explicitly enter false + // if user don't want to include children vertex count @Override public int getVertexCount() { + return getVertexCount(false); // Calls the main method with default false + } + @Override + public int getVertexCount(boolean includeChildren) { int count = 0; // If the shape is a group, recursively count the vertices of its children if (family == GROUP) { + if(!includeChildren){ + return 0; + } // Iterate through all the child shapes and count their vertices for (int i = 0; i < getChildCount(); i++) { - count += getChild(i).getVertexCount(); // Recursive call to get the vertex count of child shapes + count += getChild(i).getVertexCount(true); // Recursive call to get the vertex count of child shapes } } else { if (root.tessUpdate) { @@ -1666,7 +1674,6 @@ public class PShapeOpenGL extends PShape { } - @Override public PVector getVertex(int index, PVector vec) { if (vec == null) vec = new PVector(); From d4300995faccf8ef42ab6b5f544b74353539f7df Mon Sep 17 00:00:00 2001 From: Aditya Chaudhary Date: Tue, 4 Feb 2025 20:55:26 +0530 Subject: [PATCH 03/11] JavaDocs Updated for getVertexCount() in PShape class --- core/src/processing/core/PShape.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/processing/core/PShape.java b/core/src/processing/core/PShape.java index 27c66b472..09c5e0736 100644 --- a/core/src/processing/core/PShape.java +++ b/core/src/processing/core/PShape.java @@ -2335,13 +2335,13 @@ public class PShape implements PConstants { } /** - * The getVertexCount() method returns the number of vertices that - * make up a PShape. In the above example, the value 4 is returned by the + * The getVertexCount() method returns the number of vertices (with an option to count children by passing true as boolean parameter to method call) that + * make up a PShape. By default, it does not count child vertices for GROUP shapes. To include child vertices, pass true as a boolean parameter. In the above example, the value 4 is returned by the * getVertexCount() method because 4 vertices are defined in * setup(). * * @webref pshape:method - * @webBrief Returns the total number of vertices as an int + * @webBrief Returns the total number of vertices as an int with an option to count children Vertex for GROUP Shapes * @see PShape#getVertex(int) * @see PShape#setVertex(int, float, float) */ From 3154e1ce95631371483e714954715581e96f6251 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Mon, 10 Feb 2025 22:42:36 +0100 Subject: [PATCH 04/11] Github runners --- .github/workflows/pull_request-gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request-gradle.yml b/.github/workflows/pull_request-gradle.yml index 8518dda78..11ae6f05a 100644 --- a/.github/workflows/pull_request-gradle.yml +++ b/.github/workflows/pull_request-gradle.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: include: - - os: [self-hosted, linux, ARM64] + - os: ubuntu-24.04-arm os_prefix: linux arch: aarch64 - os: ubuntu-latest From 3b6ec0accf215b56934f28c18969619ba97919f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20de=20Courville?= Date: Tue, 11 Feb 2025 11:16:54 +0100 Subject: [PATCH 05/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 157f98ff8..d8c14db5d 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ For licensing information about the Processing website see the [processing-websi Copyright (c) 2015-now The Processing Foundation -## All Contributors List +## Contributors Add yourself to the contributors list [here](https://github.com/processing/processing4-carbon-aug-19/issues/839)! From abbc43428438156e02a7e6012d3ee126ffa63bba Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Fri, 14 Feb 2025 12:44:43 +0100 Subject: [PATCH 06/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9d0a3ec18..59ca20de5 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ For a quick start: 1. Fork and clone the repository 1. Open it in IntelliJ IDEA 1. Wait for Gradle to sync +1. Next to the run Button, select the `Processing` Configuration 1. Hit Run For more information and detailed instructions, follow our [How to Build Processing](BUILD.md) guide. From 1730eb52558b2a56fdd1c98cbe9c6be805dce515 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:35:25 +0000 Subject: [PATCH 07/11] docs: update README.md [skip ci] --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d8c14db5d..ffec3f352 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,7 @@ Add yourself to the contributors list [here](https://github.com/processing/proce Xin Xin
Xin Xin

📋 🤔 Benjamin Fox
Benjamin Fox

💻 e1dem
e1dem

💻 + Aditya Chaudhary
Aditya Chaudhary

💻 From a6ad3afae183f4fcdd4d63523bd5a2b297042dd9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:35:26 +0000 Subject: [PATCH 08/11] docs: update .all-contributorsrc [skip ci] --- .all-contributorsrc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 23c2827a3..5f1aa5cc6 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1456,6 +1456,15 @@ "contributions": [ "code" ] + }, + { + "login": "inteqam", + "name": "Aditya Chaudhary", + "avatar_url": "https://avatars.githubusercontent.com/u/104833943?v=4", + "profile": "https://github.com/inteqam", + "contributions": [ + "code" + ] } ], "repoType": "github", From ca4271d894f4a96d43b0f1cbbad3b97fecb418c6 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Fri, 28 Feb 2025 15:08:15 +0100 Subject: [PATCH 09/11] Disable new schema for now --- app/src/processing/app/Base.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index a5b3ac7c0..27b194a0a 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1366,10 +1366,10 @@ public class Base { * @param schemeUri the full URI, including pde:// */ public Editor handleScheme(String schemeUri) { - var result = Schema.handleSchema(schemeUri, this); - if (result != null) { - return result; - } +// var result = Schema.handleSchema(schemeUri, this); +// if (result != null) { +// return result; +// } String location = schemeUri.substring(6); if (location.length() > 0) { From 1f629483b8e3ad195372a798343e052887e4e9a8 Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Fri, 28 Feb 2025 16:19:36 +0100 Subject: [PATCH 10/11] Update build.gradle.kts --- app/build.gradle.kts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ccdd34fb6..d9bb94168 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -234,4 +234,24 @@ afterEvaluate { "renameWindres" ) } + tasks.register("setExecutablePermissions") { + description = "Sets executable permissions on binaries in Processing.app resources" + group = "compose desktop" + + doLast { + val resourcesPath = layout.buildDirectory.dir("compose/binaries") + fileTree(resourcesPath) { + include("**/resources/**/bin/**") + include("**/resources/**/*.sh") + include("**/resources/**/*.dylib") + include("**/resources/**/*.so") + include("**/resources/**/*.exe") + }.forEach { file -> + if (file.isFile) { + file.setExecutable(true, false) + } + } + } + } + tasks.findByName("createDistributable")?.finalizedBy("setExecutablePermissions") } \ No newline at end of file From f3a8ec6e85f632118c80945c4636f7e336c94f6f Mon Sep 17 00:00:00 2001 From: Stef Tervelde Date: Tue, 4 Mar 2025 15:47:52 +0100 Subject: [PATCH 11/11] Added jdk.accessibility --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index d9bb94168..e7ef2e5b3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -46,7 +46,7 @@ compose.desktop { ).map { "-D${it.first}=${it.second}" }.toTypedArray()) nativeDistributions{ - modules("jdk.jdi", "java.compiler") + modules("jdk.jdi", "java.compiler", "jdk.accessibility") targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "Processing"