Anki/ts/image-occlusion
Aristotelis c828a2eb6f
Add APIs for IO card rendering (#2739)
* 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>
2023-10-20 09:36:46 +10:00
..
notes-toolbar Experiment with disabling prettier whitespace sensitivity 2023-06-01 11:11:26 +10:00
shapes Add APIs for IO card rendering (#2739) 2023-10-20 09:36:46 +10:00
tools Fix selected shapes shifting to canvas origin (#2729) 2023-10-13 09:58:43 +10:00
add-or-update-note.ts Combine all backend methods into a single js/d.ts file, like in Python 2023-07-03 13:46:38 +10:00
canvas-scale.ts Various changes to I/O handling (#2513) 2023-05-31 13:45:12 +10:00
icons.ts Add text tool to image occlusion (#2705) 2023-10-12 13:40:11 +10:00
image-occlusion-base.scss Add scss formatter 2023-07-03 09:44:38 +10:00
ImageOcclusionPage.svelte Fix "Add" button showing when editing I/O note; hide toast 2023-09-19 14:19:51 +10:00
ImageOcclusionPicker.svelte Refactor IO image pickers into separate component (#2710) 2023-10-10 13:26:20 +10:00
index.ts image occlusion button in note editor (#2485) 2023-07-27 22:45:49 +10:00
lib.ts Migrate to protobuf-es (#2547) 2023-06-14 22:47:37 +10:00
mask-editor.ts Add text tool to image occlusion (#2705) 2023-10-12 13:40:11 +10:00
MaskEditor.svelte Fix some issues with undo/redo in mask editor (#2649) 2023-09-10 13:26:41 +10:00
Notes.svelte image occlusion button in note editor (#2485) 2023-07-27 22:45:49 +10:00
review.scss Add scss formatter 2023-07-03 09:44:38 +10:00
review.ts Add APIs for IO card rendering (#2739) 2023-10-20 09:36:46 +10:00
StickyFooter.svelte Fix "Add" button showing when editing I/O note; hide toast 2023-09-19 14:19:51 +10:00
store.ts follow-up pr for io button in note editor (#2600) 2023-07-31 14:24:26 +10:00
Tags.svelte fix image height issues in iOS safari (#2480) 2023-04-26 16:01:04 +10:00
Toast.svelte Fix "Add" button showing when editing I/O note; hide toast 2023-09-19 14:19:51 +10:00
Toolbar.svelte Add text tool to image occlusion (#2705) 2023-10-12 13:40:11 +10:00
tsconfig.json Various changes to I/O handling (#2513) 2023-05-31 13:45:12 +10:00
types.ts Various changes to I/O handling (#2513) 2023-05-31 13:45:12 +10:00