processing / processing/p5.js

ellipseMode(CORNERS) with circle() does not draw a circle

Open
#5,284 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Core Bug
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Most appropriate sub-area of p5.js?
  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)
Details about the bug:
  • p5.js version:
  • Web browser and version:
  • Operating System:
Example Code
function setup() {
  createCanvas(100, 100);
  ellipseMode(CORNERS);
}

function draw() {
  background(220);
  circle(10, 30, 70);
}
Output

image

Reason

The p5.js circle() function passes on the arguments to ellipse(), by specifying the third arg twice.

So, circle(x, y, d) becomes ellipse(x, y, d, d)

With ellipseMode(CORNERS), the corners of the ellipse are specified as coords.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided p5.js example, focusing on circle(), ellipse(), and ellipseMode(CORNERS). Trace the rendering path for these entry points and verify that the completed behavior preserves a circular shape when CORNERS mode is active.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.