Skip to content

Commit 691b653

Browse files
committed
[editor] Add an Ink editor
- Approximate the drawn curve by a set of Bezier curves in using js code from https://github.com/soswow/fit-curves. The code has been slightly modified in order to make the linter happy.
1 parent 2fbf14a commit 691b653

11 files changed

+1417
-3
lines changed

l10n/en-US/viewer.properties

+2
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,7 @@ editor_none.title=Disable Annotation Editing
255255
editor_none_label=Disable Editing
256256
editor_free_text.title=Add FreeText Annotation
257257
editor_free_text_label=FreeText Annotation
258+
editor_ink.title=Add Ink Annotation
259+
editor_ink_label=Ink Annotation
258260

259261
freetext_default_content=Enter some text…

src/display/editor/annotation_editor_layer.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import { AnnotationEditorType, Util } from "../../shared/util.js";
2424
import { bindEvents, KeyboardManager } from "./tools.js";
2525
import { FreeTextEditor } from "./freetext.js";
26+
import { InkEditor } from "./ink.js";
2627
import { PixelsPerInch } from "../display_utils.js";
2728

2829
/**
@@ -298,6 +299,8 @@ class AnnotationEditorLayer {
298299
switch (this.#uiManager.getMode()) {
299300
case AnnotationEditorType.FREETEXT:
300301
return new FreeTextEditor(params);
302+
case AnnotationEditorType.INK:
303+
return new InkEditor(params);
301304
}
302305
return null;
303306
}

0 commit comments

Comments
 (0)