* Allow setting occlusion mask border to zero
* Switch to multi-line if statements
cf. 9740393d72
* Enforce if statement braces in dprint
---------
Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
* Simplify handling of occlusion types in editor code
- Unify updateIONoteInEditMode(), setOcclusionFieldInner() and
setOcclusionField() into updateOcclusionsField()
- Don't use `includeInactive` property of Shape class in editor code
- Drop `isEditMode`
+
Update the occlusions field every time a mask or text is updated, not
only in editing mode but also in adding mode, so that IO cards can be
previewed correctly in the card layout screen
* Indicate current occlusion type in pop-up menu
https://forums.ankiweb.net/t/anki-23-10-beta-5-6/35677/46
* Fix a11y warnings in Toolbar.svelte
* Drop `occludeInactive` parameter from `MaskEditorAPI.getShapes()`
* Add simple mask editor add-on API
* Signal completed mask editor image loading to Python
* Add API methods for querying mask editor state, fix formatting
* Use event forwarding to propagate image loaded event
Should fix mobile support by moving all bridgeCommand calls to `NoteEditor.svelte`
* Add shape classes to mask editor API
---------
Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
* Refactor: Add index to shapes package
* Add shape draw callback API to setupImageCloze
* Expose IO drawing API, switch away from image cloze naming
We currently use "image occlusion" in most places, but some references to "image cloze" still remain. For consistency's sake and to make it easier to quickly find IO-related code, this commit replaces all remaining references to "image cloze", only maintaining those required for backwards compatibility with existing note types.
* Add cloze ordinal to shapes
* Do not mutate original shapes during (de)normalization
Mutating shapes would be a recipe for trouble when combined with IO API use by external consumers.
(makeNormal(makeAbsolute(makeNormal())) is not idempotent,
and keeping track of the original state would introduce
additional complexity with no discernible performance benefit
or otherwise.)
* Tweak IO API, allowing modifications to ShapeProperties
* Tweak drawShape parameters
* Switch method order
For consistency with previous implementation
* Run Rust formatters
* Simplify position (de)normalization
---------
Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
* Drop support for checkpoints
* Deprecate .flush()
* Remove .begin/.commit
* Remove rollback() and deprecate save/autosave/reset()
There's no need to commit anymore, as the Rust code is handling
transactions for us.
* Add safer transact() method
This will ensure add-on authors can't accidentally leave a transaction
open, leading to data loss.
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
* Revert "Fix selected shapes shifting to canvas origin"
This reverts commit d81b96fed0adb7db2fb9847c52d7cb73f83b4b32.
This introduced a regression where the selection of objects was cleared
when it should not have been. For example, if multiple objects were
selected and the mouse was released while moving them around, the
selection would be cleared.
* Another approach to preventing selected shapes from shifting
Prevent fabric objects from shifting to the wrong position when the
active selection contains multiple objects by calculating their
coordinates relative to the canvas, as in the case of the fabric.Group.
If you have an add-on that hasn't been updated yet, please contact
the add-on author. You can temporarily restore functionality by defining
an ENABLE_QT5_COMPAT=1 env var.
* Remove v1/v2 support from deck list
* Remove v1/v2 support from most routines and show error
* Remove scheduler_version from preferences
* Fix formatting
* Remove v1/v2 conditionals from Python code
* Fix legacy importer
* Remove legacy hooks
* Add missing scheduler checks
* Remove V2 logic from deck options screen
* Remove the review_did_undo hook
* Restore ability to open old options with shift (dae)