mapbox / mapbox/mapbox-gl-js

Mapbox line-pattern distorts the image

Open
#8,752 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I am applying **line-pattern** property to a Line but the result is distorted.

The image width is a factor of two (32 or 64px) and I am using a fixed width for the line (I am not trying to scale it with the zoom - which is much worse btw)

paint: {
'line-pattern':fillPatternName,
'line-width': 32,
},

**Example:**
Here is the pattern: https://imgur.com/a/uJqkkTj
And this is the actual result: https://imgur.com/a/4sj1jgv

As you can see it will create an angle in the pattern and also the repeat is inconsistent as it will start repeating the pattern without finishing the previous pattern draw (overlaping).

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

No source file or test is named. Reproduce the reported case with the provided 32/64px pattern and fixed line-width of 32, then trace the line-pattern rendering path; done means the pattern has no angle distortion and repeats without overlapping or truncating the previous repeat.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.