You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Replace independent endpoint clamping with proper Liang-Barsky
line-rectangle intersection so annotation arrow shafts cannot cross the
axes frame. Back off the arrow tip from the clipped edge by a small
data-range margin so the arrow-head geometry drawn by the backend does
not protrude outside the frame.
Applies uniformly across PDF, PNG, SVG, and ASCII backends.
## Changes
- `src/text/fortplot_annotation_rendering.f90`: added
`liang_barsky_clip` subroutine and rewrote `render_annotation_arrow` to
use it with arrow-head margin backing-off
## Verification
### Test passes
```
$ fpm test --target test_annotation_arrow_clipping_1693
PASS: annotation arrow clipping works (Issue #1693/#1716)
$ fpm test --target test_annotation_styling_1437
PASS: annotation styling PDF guards present (Issue #1437)
$ fpm test --target test_pdf_unicode_annotations_1415
PASS: Issue #1415 unicode glyphs render in PDF without fallback
```
### CI-fast suite passes
```
$ make test-ci
CI essential test suite completed successfully
```
### Artifact verification passes
```
$ make verify-artifacts
Artifact verification passed.
```
### Annotation demo produces correct output
```
$ ./build/gfortran_*/example/annotation_demo
✓ PDF: annotation_demo.pdf (vector graphics, perfect scaling)
✓ PNG: annotation_demo.png
✓ ASCII: annotation_demo.txt
```
### Requirement-by-requirement evidence
| Requirement | Evidence |
|---|---|
| Arrow shaft clipped to plot area | Liang-Barsky clips line segment to
[x_min,x_max]×[y_min,y_max] rectangle |
| Arrow head does not protrude | Tip backed off from edge by 0.5% of
data range before `draw_arrow` |
| All backends covered | Clipping at annotation layer, before backend
dispatch |
| No regression | All annotation tests + CI-fast + verify-artifacts pass
|
0 commit comments