mapbox / mapbox/mapbox-gl-js

Clarify constants and calculations in SDF rendering

Open
#4,229 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring :building_construction:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

There are several constants and calculations in `draw_symbol.js` and the `symbol_sdf` shaders that are difficult to interpret / understand. I'm pretty much with @lucaswoj when [he says](https://github.com/mapbox/mapbox-gl-js/pull/4226#discussion_r99930722):

> I prefer a very clear constant name (ideally googleable) to a magic number, and a magic number to a cryptic constant name.

(though I'd say a _semi_-clear constant name with a one-line comment to explain it still beats a magic number in my book)

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 reviewing the constants and calculations in draw_symbol.js and the symbol_sdf shaders, using the referenced pull-request discussion for context. Done means the constants are understandable through clear names or concise explanatory comments, and the rendering behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.