master ← ff/fix-lines
opened 01:37PM - 25 Jul 25 UTC
# Description
This restores the init-time decision between having a line patt…ern texture or not, and replaces `lastlength` arrays with dummy data when they are not needed. This fixes an issue reported on Slack, where random segments of a line disappear:
```julia
using GLMakie, Dates
f,a,p = lines(Date(2000):Year(1):Date(2009), rand(10))
```
<img width="578" height="426" alt="grafik" src="https://github.com/user-attachments/assets/a1d53284-23d2-4bd7-a9b4-a55a39e454c2" />
I didn't thoroughly think through the cause of this issue, but it's probably a Float32 precision issue with `f_pattern_overwrite` in `process_pattern()` in `lines.geom`. The dates convert to large numbers ~6e13. Without patterns, GLMakie skipped projections when calculating `gl_last_length`, so that they ended up with ~6f13 values too. With the `pattern` texture always given, the shader ended up mixing those values with pixel scale offsets, which are way below float precision. I assume that (or something similar) caused texture sampling to break.
Setting `gl_last_length` to NaN's, Inf's, zeros, etc fixes the issue. Skipping the `pattern::Texture` branches does too, and it should improve performance.
## Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
## Checklist
- [x] Added an entry in CHANGELOG.md (for new features and breaking changes)
- [ ] Added or changed relevant sections in the documentation
- [ ] Added unit tests for new algorithms, conversion methods, etc.
- [x] Added reference image tests for new plotting functions, recipes, visual options, etc.