Skip to content

UI: keep every texture within the GPU max texture side - #652

Merged
h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
NikitkaRa:fix/texture-limits
Oct 14, 2026
Merged

h-a-n-a-s-h-i merged 2 commits into
storytold:mainfrom
NikitkaRa:fix/texture-limits

Conversation

@NikitkaRa

Copy link
Copy Markdown
Contributor

Stacked on #644 (review that first; the only new commit here is the last one, 05eb4c6). No issue: these are runtime aborts found in the startup-robustness sweep.

Summary

  • Shrink every texture to the GPU limit:
    • New textures::upload / textures::replace box-average a picture past max_texture_side down to fit. Before this, egui panicked ("Texture … has size …, but the maximum texture side is 2048").
    • Every texture now goes through them:
      • slide show, transition parts and morph frames
      • slide thumbnails, master/layout thumbnails, the layout gallery and Design Ideas previews
      • the master-view canvas and the presenter-view "Next" preview
      • video frames
  • Fit render sizes to the limit before rendering (textures::fit_size):
    • A 2600 px-wide (or high-DPI) slide show screen no longer renders a frame the GPU can't hold. It renders at the limit and is drawn stretched.
    • A 1:56 slide, the tallest design.slideSize allows, no longer renders 195×10920 thumbnails or a 480×26880 presenter preview.
  • Master view: the master-view canvas is cropped to the visible area, like the slide canvas in Startup: survive damaged settings, font folders, recovery folders and small texture limits #644.
  • Also checked, nothing to fix:

Test plan

  • texture_limit_tests::a_slide_show_on_a_screen_wider_than_the_texture_limit: panicked before ("slide-canvas" 2126×1196)
  • texture_limit_tests::a_very_tall_slide_in_the_editor_views_and_presenter_view: covers the sorter, Slide Master, and presenter view with the show; panicked before ("thumb-0" 195×10920)
  • textures::fit_tests: fit_size and shrink_to keep shape and colours, and leave small pictures as they are
  • I checked the presenter view render by eye
  • cargo xtask ci: all 6 steps pass

Parity checklist: no user-visible features change. This is robustness only.

NikitkaRa and others added 2 commits October 14, 2026 03:27
… small texture limits

- ui.json / prefs.json are read through a new settings module: regular files only, 4 MiB
  cap, parse errors logged, values sanitized (a saved zoom of 1e30 aborted start-up,
  1e4 panicked in egui); writes are atomic.
- The canvas and the control protocol clamp stray zooms; the status bar shows the zoom in use.
- The canvas texture is cut to the GPU's max texture side (zoom 400% on a 2048 limit panicked).
- The system font scan opens only regular files of sane size (a FIFO named *.ttf in ~/.fonts
  hung start-up), with depth and entry caps.
- AutoRecover skips non-regular entries and reopens at most 32 per start, newest first.

Co-authored-by: Cursor <cursoragent@cursor.com>
Slide show, transition and morph frames, thumbnails, master-view canvas, master/layout
thumbnails, Design Ideas previews, presenter-view preview and video frames all upload through
textures::upload/replace, which shrinks a picture past max_texture_side (egui panicked on one).
Render sizes are fitted to the limit first, so a big screen, extreme DPI or a 1:56 slide
doesn't render a picture the GPU can't hold. The master canvas is cropped like the slide canvas.

Co-authored-by: Cursor <cursoragent@cursor.com>
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit e225e4e into storytold:main Oct 14, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
…reviews, show grid) go through textures::upload so they stay within the GPU max texture side (#652)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 14, 2026
… on land-r5 (#644 #652 #655 #702 #571 #539 #674 #648 #697 #479 #369 #368)

# Conflicts:
#	crates/ui-egui/src/canvas.rs
#	crates/ui-egui/src/ribbon.rs
@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you for this contribution, @NikitkaRa! It has landed on main and will ship in the next DeckCraft release.

If you haven't already, please come join us on Discord: https://discord.gg/artcraft

anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…torytold#658)

* Print: list driverless CUPS destinations, not only permanent queues

The Print dialog's printer list came from `lpstat -p -d`, which lists only
permanent queues. A driverless IPP printer discovered on the network — the
standard setup on modern Linux desktops — has no permanent queue: only
`lpstat -e` (CUPS >= 1.7) names it, and CUPS builds a temporary queue when
`lp` sends it a job. Until now such printers were invisible and the dialog
showed only Save as PDF.

Enumerate `lpstat -e` alongside `lpstat -p -d` and merge the answers: queues
first, deduplicated, default still from `-d`; a spooler without `-e` keeps
today's behaviour and loses only the driverless names. The .deb/.rpm now
recommend cups-client so a machine without a print stack is not silently
printerless.

Fixes storytold#652

Co-authored-by: ZCode (GLM-5.3) <noreply@z.ai>

* Print: fix the off-unix build and a driverless default's marker

`lpstat_e_command` is called only from `printers`' unix block, so off unix
it was dead code and CI's Windows clippy gate (`-D warnings`) failed to
build the crate. Gate it like its caller.

The default destination can itself be driverless — `lpoptions -d` names a
destination no queue exists for — and the merge appended it from
`lpstat -e` with `default: false`, so the dialog preselected the first
queue instead of the user's default. The `-d` default now marks the
appended entry too; the test covers it, and CRLF in `-e` output.

Co-authored-by: ZCode (GLM-5.3) <noreply@z.ai>

---------

Co-authored-by: ZCode (GLM-5.3) <noreply@z.ai>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants