Skip to content

Commit

Permalink
[editor] Add an Ink editor
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
calixteman committed Jun 8, 2022
1 parent 2fbf14a commit c2b66dd
Show file tree
Hide file tree
Showing 11 changed files with 1,408 additions and 3 deletions.
653 changes: 653 additions & 0 deletions external/fit_curve/fit_curve.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions l10n/en-US/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,7 @@ editor_none.title=Disable Annotation Editing
editor_none_label=Disable Editing
editor_free_text.title=Add FreeText Annotation
editor_free_text_label=FreeText Annotation
editor_ink.title=Add Ink Annotation
editor_ink_label=Ink Annotation

freetext_default_content=Enter some text…
3 changes: 3 additions & 0 deletions src/display/editor/annotation_editor_layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import { AnnotationEditorType, Util } from "../../shared/util.js";
import { bindEvents, KeyboardManager } from "./tools.js";
import { FreeTextEditor } from "./freetext.js";
import { InkEditor } from "./ink.js";
import { PixelsPerInch } from "../display_utils.js";

/**
Expand Down Expand Up @@ -298,6 +299,8 @@ class AnnotationEditorLayer {
switch (this.#uiManager.getMode()) {
case AnnotationEditorType.FREETEXT:
return new FreeTextEditor(params);
case AnnotationEditorType.INK:
return new InkEditor(params);
}
return null;
}
Expand Down
Loading

0 comments on commit c2b66dd

Please sign in to comment.