Paint changes
=============

3.21 (15 Oct 2026)
  PNG and JPEG are always made by Paint's own encoders on RISC OS 64.

  - Paint no longer loads ZLib, PCompMod or JCompMod on a 64-bit system, and
    export_is_native (c/export.c) treats PNG and JPEG as native there even
    if a copy of those ARM32 modules is present. A 64-bit system cannot run
    ARM32 module code: the first compress call died with an undefined
    instruction and took Paint with it. The 32-bit build is unchanged.

3.20 (15 Oct 2026)
  Save boxes name their files by format; screenshots default to JPEG.

  - Every export (PNG, JPEG, BMP, TGA, GIF, ICO), every screenshot and a
    single sprite's Save now suggest "Name/ext" in the RISC OS style
    (c/savenamecalc.c): spr, png, jpg, bmp, tga, gif, ico. A name that
    already ends in "/xxx" is left alone, except that the extension of
    another Paint format is replaced by this format's ("pic/png" becomes
    "pic/jpg" when exporting JPEG). The sprite saved by dragging is still
    named without the "/spr".
  - Snapshot now starts with JPEG selected (it was Sprite), so a screenshot
    is offered as "Name/jpg" at quality 75 (the PEQUAL line of Messages);
    Sprite and PNG stay selectable.
  - Every save and export drag goes through DragASprite (unchanged: checked).

3.13 (09 Oct 2026)
  Multi-level undo and redo in a sprite window (new c/undo.c, c/undocalc.c).

  - Edit > Undo (F8) and Edit > Redo (F9) take back and put back changes to
    a sprite. Both are greyed out when there is nothing to do, and any new
    change clears what there was to redo.
  - The stacks are per sprite and go with it: closing a sprite or a file
    frees its records, and nothing is left when Paint quits.
  - Each record is a copy of the whole sprite - header, image and mask -
    because an operation may change its size, mode, mask or palette. They
    live in a "Paint undo" dynamic area, made when the first change is made
    and removed again as soon as the last record goes, so a Paint that is
    not being drawn in holds no memory for undo.
  - Choices has "Undo steps", 0 to 99, default 10, saved as "UndoDepth" in
    the Choices file; 0 turns undo off. There is also a 6MB cap on all the
    records together, and the oldest go first when either cap is reached.
  - What pushes a record: every tool, at the click that starts it; flip
    (menu and F2/Shift-F2); rotate, scale x, scale y, magnify and shear;
    change size, and insert or delete rows and columns; resolution; adding
    or removing the mask or the palette; and a sprite overwritten by one
    coming in from the clipboard, a drag or a sprite file.
  - Convert colours pushes nothing: it makes a new sprite of its own and
    changes none.

  Notes
  - The menu entries read "Undo" and "Redo" without the name of the
    operation. Naming it needs a menu entry pointing at a buffer, which
    lib/desktop can only do by making the entry writeable.
  - Pasting or dropping a sprite file that only adds sprites is not undone;
    the undo state is per sprite, and nothing of a sprite is lost by adding
    another. A sprite that is overwritten is saved first.

3.12 (08 Oct 2026)
  Fixes from Paint 2.59b (08 Oct 2026), a 32-bit RISC OS 5 update. The
  developer's source and VersionNum name no author or maintainer, so the
  work is credited to "the Paint 2.59b developer"; the files carry the
  Apache 2.0 licence and the copyright lines of Acorn Computers Ltd, Castle
  Technology Ltd and RISC OS Open Ltd, which are kept. The code below was
  ported by hand to this 64-bit Paint (new code is MIT).

  - Loading a sprite file, or dropping one, on a window with sprites
    selected no longer deletes the selected sprites; it only deselects them
    (c/main.c, from main.c's load).
  - Snapshot (Misc > Snapshot) can save the picture as a PNG or JPEG as
    well as a sprite: three radio buttons in the snapshot window (the
    "snapshot" template), d_Snapshot_Sprite/PNG/JPEG in c/menud.h and the
    snapshot_img_type choice, which this port keeps between uses.
  - The snapshot window puts the caret in the seconds field when "Delay" is
    chosen and takes it out again when it is not.
  - The snapshot help text (Messages PntHE) mentions JPEG and PNG.

  Port notes
  - The snapshot sprite for a PNG or JPEG export outlives the snapshot call
    (the export's box stays up), so it is held in heap storage and given back
    through a release callback on the export (export_start_owned in
    c/export.c). Paint 2.59b passes a stack sprite to the export.
  - The "fade PNG/JPEG if the Compress modules are absent" step is not
    ported: this Paint's exporter encodes both itself when the modules are
    missing, so they are always available.
  - Template window-flag byte changes (bit 21) and a stray empty string in
    save_png/save_jpeg in 2.59b's Templates are save artefacts and were not
    taken.
