Skip to content

feat(export): trim pages to visible content - #6

Merged
nmrtist merged 2 commits into
mainfrom
feat/trim-visible-export-content
Jul 22, 2026
Merged

feat(export): trim pages to visible content#6
nmrtist merged 2 commits into
mainfrom
feat/trim-visible-export-content

Conversation

@nmrtist

@nmrtist nmrtist commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Add opt-in trimming of exported PlotX pages to visible content.

  • Add a sticky Trim page to visible content option to the export dialog.
  • Support PNG, JPEG, TIFF, SVG, and PDF while preserving format-specific 1 px / 1 pt safety padding.
  • Compute bitmap bounds from final lossless RGBA pixels before encoding.
  • Compute SVG bounds from clip-aware rendered geometry while excluding the page background and visually redundant figure backgrounds.
  • Generate PDF pages from trimmed SVGs, including distinct MediaBox sizes for multi-page exports.
  • Preserve empty pages at their authored size and apply journal preset scaling without refitting cropped content.
  • Propagate raster crop and allocation failures through the existing user-visible export error path.
  • Include follow-up correctness fixes for axis simplification, minimum-cell spacing invariants, shared tiling direction logic, and tile-preview cache identity.

Project and settings schema versions remain unchanged.

Validation

  • cargo pr-check — passed
  • npm run build from docs/ — passed
  • git diff --check — passed

nmrtist added 2 commits July 22, 2026 23:01
Add sticky, opt-in trimming for bitmap, SVG, and PDF exports. Compute clip-aware vector bounds, preserve format-specific safety padding, and propagate raster crop failures. Include follow-up correctness fixes for axis simplification, visual spacing invariants, and tile-preview cache identity.
Map SVG's generic sans-serif family to an installed platform font so text contributes bounds during trim, raster, and PDF parsing on Ubuntu.
@nmrtist
nmrtist marked this pull request as ready for review July 22, 2026 15:16
@nmrtist
nmrtist merged commit bc8bc5d into main Jul 22, 2026
11 checks passed
@nmrtist
nmrtist deleted the feat/trim-visible-export-content branch July 22, 2026 15:16
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant