processing / processing/p5.js

shadowBlur overlays on top of fill

Open
#4,619 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Most appropriate sub-area of p5.js?
  • Color
  • Core/Environment/Rendering
  • Data
  • Dom
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)
Details about the bug:
  • p5.js version: 1.0.0
  • Web browser and version: firefox 77.0.1 / chrome 83.0.4103.97 (Official Build) (64-bit)
  • Operating System: windows 10
  • Steps to reproduce this:

https://editor.p5js.org/micuat/sketches/R7YwWXnJU

The shadow of the stroke goes on top of the filled surface.

Actually, the problem is here
https://github.com/processing/p5.js/blob/main/src/core/p5.Renderer2D.js#L524-L529

When I reverse the order of fill and stroke like in this sketch, this problem goes away
https://editor.p5js.org/micuat/sketches/2I_nsQDEN

If reversing the order doesn't affect anything, then I will make a PR

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 with src/core/p5.Renderer2D.js at lines 524-529 and reproduce the behavior using the linked p5.js Editor sketches. Compare the fill and stroke ordering, then verify that the shadow no longer overlays the filled surface without changing other rendering behavior.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.