Skip to content

Conversation

@SThor
Copy link
Owner

@SThor SThor commented Apr 27, 2025

No description provided.

@SThor SThor changed the base branch from main to dev/refactoring-bezier April 27, 2025 20:49
@SThor SThor requested a review from Copilot April 27, 2025 21:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors drawing routines in PaperAndPencil.java to improve code reuse and consistency in mathematical function calls. Key changes include:

  • Replacing p.TWO_PI with PConstants.TWO_PI for a constant reference.
  • Introducing helper methods (setupDrawingState and setFillWithAlpha) to centralize drawing state setup.
  • Changing instance-based math calls (e.g., p.cos, p.sin, p.lerp, p.dist) to use their static PApplet counterparts.
Comments suppressed due to low confidence (2)

src/paperandpencil/PaperAndPencil.java:132

  • Review the change from using the instance-based p.cos() to the static PApplet.cos(); ensure that the static method provides behavior equivalent to the instance method, particularly if the PApplet instance has custom state or behavior.
x = centerX + diameter/2 * PApplet.cos(theta);

src/paperandpencil/PaperAndPencil.java:151

  • Verify that replacing the instance method p.dist() with the static PApplet.dist() does not bypass any instance-specific behavior or adjustments in distance calculations.
float increment = 0.15f / PApplet.dist(x1, y1, x2, y2);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant