[Therion] Mapiah release 0.4.0: The Pains release
Rodrigo Severo
rsev at pm.me
Wed Apr 22 12:33:07 CEST 2026
Hi,
I have just released Mapiah version 0.4.0. I believe its quite interesting: https://github.com/rsevero/mapiah/releases/tag/v0.4.0
# Changelog
## 0.4.0 - 2026-04-22 - The [Pains](https://www.instagram.com/epapains?igsh=MXdvYXprbGFkc245ZA==) release
* Highlights:
* Drawing and editing lines is much more fluid: Mapiah quadratic and xTherion cubic smooth creation gained straights↔curves conversion, constrained placement/dragging, node deletion, keyboard nudging, full-path cancel, and quicker entry into single-line edit mode.
* Element transforms became a major new editing workflow: selected elements can now be scaled, rotated, and flipped in place with live preview, undoable finalization, improved Inkscape-style handles, and better state-context tools.
* Background-image workflows are stronger with Mapiah-only SVG image support, safer path handling during insert and Save as, and immediate zoom/bounds refresh so imported images behave correctly in both new and existing TH2 files.
* Repeated drawing tasks are faster thanks to the new last-used point/line/area type strip, which is localized, seeded from existing files, reacts live to edits, and stays accessible in its own scrollable bar above the status area.
* The release also rounds out many editor papercuts, including the interactive line simplification dialog, more reliable paste/zoom/tab behavior, persistent bottom action areas in dialogs/settings, and a desktop-only repository cleanup aligned with supported targets.
* New features:
* While drawing a "Mapiah quadratic" or "xTherion cubic smooth" line, `Shift+L` converts the last (unfinished) segment from a Bézier curve to a straight line and `Shift+U` converts it from a straight line to a Bézier curve (control points placed at one-third and two-thirds of the chord). EN/PT help pages and keyboard-shortcut documentation updated, and widget coverage added.
* Pressing `Esc` while drawing an unfinished "Mapiah quadratic" or "xTherion cubic smooth" line now cancels the entire in-progress path and resets to a fresh start within line-creation mode, with help pages and keyboard-shortcut documentation updated (EN/PT) and regression coverage added.
* The "Mapiah quadratic" new-line creation method now lets you hold Shift while dragging a fresh control point to constrain it to the nearest multiple of the configured snap angle relative to the shared node. Updated PT help pages and widget coverage alongside the existing xTherion behavior.
* Added an optional bottom-of-canvas strip for last-used point, line, and area element types/subtypes in the TH2 editor, shown behind the existing action buttons, localized with the existing PLA naming helpers, and wired to reuse the regular add-element mode transitions. [request by Axel Hack]
* Added Mapiah-only SVG background image support with `MPSVGImageInsertConfig`, on-canvas rendering, metadata persistence, import validation for `viewBox` / `width` / `height`, EN/PT help updates, and regression coverage. [request by Axel Hack]
* Added an interactive line simplification dialog (`Ctrl+Alt+Shift+L`) with a dedicated state-context FAB, live preview for method and intensity changes, close/save/cancel handling with single-step undo semantics, EN/PT help updates, and regression coverage.
* The interactive line simplification dialog is now draggable: right-click-drag on the title bar repositions it anywhere on screen, clamped to screen bounds, consistent with overlay window behaviour.
* The Save button in the interactive line simplification dialog now commits the current simplified version as an undoable action without closing the dialog, allowing further adjustments from the committed state.
* Added a Reset button to the interactive line simplification dialog that restores method and intensity to their hardcoded defaults (`keepOriginalTypes` / intensity 1) and re-applies the preview. Close and Save both now persist the selected method for next use.
* Double-clicking a line or one of its visible line segments on the canvas now enters single-line edit mode, with widget coverage for both hit paths.
* Selection-mode element transforms: selected elements can be rotated and scaled in-place via corner handles, with live preview and finalization producing undoable commands. Keyboard nudging, Alt/Shift/Ctrl modifiers, and selection-handle hit-testing were refined to match image transform controls.
* When `TH2Edit_EnableElementTransforms` is active, the selection bounding-box handles now render as Inkscape-style arrow handles matching the image transform controls: eight double-arrow scale handles in the default selection state, and four curved-arrow rotation handles in element-rotate mode; the original simple-line handles are shown when the setting is off.
* Fixed bugs:
* Mapiah quadratic line creation now also supports Inkscape-style deletion of the last drawn node with `Backspace` or `Delete` while drawing. If the deleted node was the only completed segment, Mapiah rolls back to the original start node so drawing can continue from there. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* xTherion cubic smooth line creation now supports Inkscape-style deletion of the last drawn node with `Backspace` or `Delete` while drawing. If the deleted node was the only completed segment, Mapiah rolls back to the original start node so drawing can continue from there. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* Corner scale-handle cursors were visually inverted due to the Therion/Flutter Y-axis difference; `topLeft`/`bottomRight` now show `resizeUpRightDownLeft` and `topRight`/`bottomLeft` show `resizeUpLeftDownRight`.
* After completing a scale or rotation drag, the first subsequent click on a selected element was silently ignored because `_ignoreNextClick` was set on pointer-down but never cleared by the drag-end path; the flag is now reset in `_resetScalePreview` and `_resetPreview` so a single click immediately switches scale↔rotate mode.
* The element-rotate state now shows the same context FAB panel as the scale (non-empty selection) state, giving access to simplify, convert, edit-tools, split/join/merge, clipboard, and select-all buttons while in rotate mode.
* Clicking an already-selected element in scale mode no longer shows the "multiple elements clicked" dialog before switching to rotate mode; a fast path now checks selection state without a dialog and transitions immediately.
* H/V flip FAB buttons are now shown in both element scale and rotate modes, allowing elements to be mirrored horizontally or vertically directly from either transform state.
* When a single selected element is a point, the element-transform scale and rotate handles are now hidden even if `TH2Edit_EnableElementTransforms` is enabled.
* The bottom strip of last-used PLA type buttons now refreshes immediately when the tracked area/line and point last-used lists change, including point-type edits from the options overlay.
* The bottom strip of last-used PLA type buttons now shows a centered divider between the area/line and point groups, with tuned asymmetric spacing so the split reads clearly without crowding either side.
* Opening an existing TH2 file now seeds the last-used PLA tracking from the file contents as well as the most-used counters, so the last-used PLA strip is populated immediately from the existing drawing instead of staying on defaults until a later edit.
* Opening an existing TH2 file now correctly enables the Select tool / Select all actions as soon as the file loads. The controller now refreshes the selectable-elements flag after load and after active-scrap changes, preventing the button from staying disabled until some later selection-side effect occurred.
* The last-used PLA type buttons now live in a dedicated bar above the status bar instead of floating over the canvas, slightly reducing canvas height. The strip no longer overflows when many point types are present, and each side now scrolls horizontally with desktop mouse drag and wheel/trackpad input so hidden buttons remain reachable.
* Slope lines whose line segments do not define any `l-size` are now painted with a dedicated special border, matching the existing visual treatment used for invisible elements and elements with THID set. Added dedicated TH2 edit settings to enable or disable each supported special-border type (`visibility off`, `ID set`, and slope without `l-size`), updated the EN/PT settings help pages, and added regression coverage.
* Deleting a middle line segment in single-line edit mode now preserves the surrounding curve much more closely by rebuilding the merged Bézier segment from the original entry and exit tangents, with regression coverage for the split-curve case.
* Pasting now zooms just enough to reveal the pasted selection when any part of it lands off screen, while leaving the current zoom unchanged when the pasted result is already fully visible.
* Subtype option overlays that are pure dropdowns no longer show separate Set/Unset radio buttons; they now include an explicit Unset entry directly in the dropdown, with regression coverage.
* The Create new TH2 file dialog now keeps its bottom action buttons visible while the dialog body scrolls by reusing `MPDialogBottomWidget`.
* The smooth-line tooltip now correctly advertises the `S` shortcut, and `Ctrl+Shift+S` once again opens the Save As dialog from the TH2 edit page.
* `Save as` now rebases imported image paths relative to the new TH2 location before writing the file, so moved SVG background images stay visible both immediately after saving and after reopening the saved file.
* Adding background images now stores paths relative to the TH2 file consistently even when tests or callers provide workspace-relative filenames, preventing `PathException` failures during image-insert command creation.
* The first `Save as` after creating a new TH2 file and inserting a background image no longer crashes with a `PathException`; new unsaved files now keep imported image paths absolute until the first save location is chosen, then convert them to a relative path from the saved TH2 file, with regression coverage for both the command flow and path rebasing.
* Settings page action buttons now stay visible at the bottom while the settings list scrolls, and the footer now reuses `MPDialogBottomWidget` for consistent dialog-style actions.
* The interactive line simplification dialog no longer grows taller than its content when the main window is resized.
* Updated EN/PT help pages and keyboard-shortcut documentation to include the new element/image transform actions and their modifiers (rotate, scale, flip). Generated localization files (`intl_*.arb` / `app_localizations_*.dart`) were updated accordingly.
* The Close button is now the default (prominent) button in the interactive line simplification dialog.
* The interactive line simplification dialog now shows a before/after segment count table (total, Bézier, straight) that updates live as the method and intensity change. The first (anchor) segment of each line is excluded from the counts.
* Closing a non-visible TH2 tab no longer leaves the editor body showing the wrong file; each tab body now keeps a stable identity, and a regression test covers the close-first-tab flow.
* Existing TH2 files are now canonicalized to normalized absolute paths inside `MPGeneralController`, so controller lookup, tab identity, telemetry, and rename/remove flows all use one consistent filename key.
* Cross-file paste and duplicate workflows no longer crash when auto-zoom tries to fit a zero-size selection or runs before the destination canvas has a valid viewport; selection-window zoom now guards against zero or non-finite scales.
* On newly created TH2 files, background-image insertion now warms raster bounds before the add completes so `Zoom to file` can fit the image immediately. `Zoom to selection` now stays inert when nothing is selected, and the zoom-window FAB once again enters window-zoom mode instead of incorrectly triggering selection zoom.
* `Zoom to file` now also invalidates cached TH2/image bounding boxes when image insert configs are added, removed, or replaced, so inserting a background image into a new file immediately refits to the full image instead of keeping the previous tiny default viewport.
* Added widget coverage for xTherion cubic smooth Ctrl-drag line creation, checking both the fixed mirrored-handle distance on the current segment and the seeded control point carried into the next segment.
* xTherion cubic smooth line creation now supports Inkscape-style corner-node handle separation while drawing: after starting the drag normally, hold Alt without releasing the mouse button to keep the current segment handle fixed and redefine only the next segment's future control point. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* xTherion cubic smooth line creation now supports Inkscape-style Shift-constrained node placement while drawing: hold Shift when setting a node to constrain it to the nearest multiple of the configured snap angle relative to the previous node. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* xTherion cubic smooth line creation now also supports Inkscape-style Shift-constrained control-point placement while dragging: hold Shift to constrain the future control point to the nearest multiple of the configured snap angle relative to the shared node. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* Added widget coverage for the Mapiah quadratic line-creation drag flow, verifying that dragging a newly placed node converts the current segment into a Bézier curve with the expected quadratic-to-cubic control-point geometry and that the conversion persists after release/finalization.
* Mapiah quadratic line creation now also supports Inkscape-style Shift-constrained node placement while drawing: hold Shift when setting a node to constrain it to the nearest multiple of the configured snap angle relative to the previous node. Updated EN/PT help pages and keyboard-shortcut documentation, and added widget coverage.
* xTherion cubic smooth line creation now supports nudging the last created node with _Arrow_, _Shift+Arrow_, _Alt+Arrow_, and _Alt+Shift+Arrow_ while drawing. The in-progress smooth handles move together with the node, and EN/PT help plus regression coverage were updated accordingly.
* Mapiah quadratic line creation now supports the same keyboard nudging shortcuts while drawing (`Arrow`, `Shift+Arrow`, `Alt+Arrow`, `Alt+Shift+Arrow`) for the last created node, with matching EN/PT help updates and regression coverage.
* When Therion exits with an error, the Run Therion dialog now stops the elapsed timer immediately and switches from the yellow running status to the final warning/error result without waiting for post-run log collation. Added widget regression coverage for the quick-finish path reported on Windows 11. [reported by CaverBruce]
* Infrastructure maintenance:
* Removed unsupported iOS and web project scaffolding plus the debug web release workflow, keeping the repository aligned with the desktop-only release targets (Linux, macOS, Windows).
* Added the persisted `TH2Edit_ShowLastUsedPLATypeButtons` boolean setting with default `true`, including EN/PT settings-page labels and generated localization updates. The setting is not wired into UI behavior yet.
* Added `_lastUsedAreaLineTypes` to `TH2FileEditElementEditController`, keeping a shared last-used list for area and line PLA type/subtype values. The last-used and most-used PLA tracking now stores dedicated `MPPLATypeSubtype` objects instead of string IDs, and `MPTypeUsed` now tracks the same typed value.
* Replaced anonymous `{type, subtype}` records used in PLA type/subtype flows with a dedicated `MPPLATypeSubtype` value object that also tracks whether the data belongs to a point, line, or area.
* Added `plaTypeSubtypeForNewElement` override support to `TH2FileEditElementEditController`, so new point/line/area creation can temporarily prefer an explicit `MPPLATypeSubtype` over the per-PLA last-used fallback. The old public `lastUsedPointType` / `lastUsedLineType` / `lastUsedAreaType` string getters were collapsed into private helpers, and creation/status flows now use the typed `get*TypeAndSubtypeForNew*()` APIs consistently.
* Extracted dedicated TH2 edit widgets for the bottom status bar, the last-used PLA button strip, and the right-side action-button stack, reducing `TH2FileEditBodyWidget` size and keeping those canvas overlays self-contained.
* Extracted the TH2 edit top-right state action buttons into `TH2FileEditStateActionButtonsWidget`, moving search/select, snap, default-options, remove, and undo/redo actions out of `TH2FileEditBodyWidget` while preserving their existing behavior.
* Extracted the TH2 edit state-context FAB panel into a dedicated widget, moving the top-left mode-specific button groups out of `TH2FileEditBodyWidget` while keeping the existing state-based behavior unchanged.
* Reorganized `TH2FileEditStateContextFABsWidget` internally by splitting the single-line and non-empty-selection FAB builders apart and keeping the shared FAB styling and row helpers in a smaller reusable section.
* Split the TH2 edit state-context FAB implementation into dedicated panel files plus shared FAB helpers under `lib/src/widgets/th2_file_edit_state_context_fabs/`, leaving `TH2FileEditStateContextFABsWidget` as a small state-based router.
* Made the last-used PLA tracking lists reactive with `ObservableList`, and updated the last-used PLA button widget to snapshot those lists inside its `Observer` so content and ordering changes trigger rebuilds reliably.
* Added unit/widget test coverage and state-machine refinements for the new element transform states and transform-command finalization paths.
* Added `TH2FileEditMoveScaleRotateElementController` and `MPTH2FileEditStateElementRotate` to centralize and enable element/image transform workflows (move, scale, rotate, flip). Selection handles now support drag-to-scale and corner-handle rotation with optional pivot locking (Shift) and angle snapping (Ctrl/Meta). Mirror (flip) actions (`H` / `V`) and undoable transform commands were added, with matching state-machine integration.
* flutter upgraded to 3.41.7
Regards,
Rodrigo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20260422/1d0e6d82/attachment-0001.htm>
More information about the Therion
mailing list