vexflow 4.0.1-beta.1 → 4.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/vexflow-bravura.js +2 -2
- package/build/cjs/vexflow-bravura.js.map +1 -1
- package/build/cjs/vexflow-core.js +2 -2
- package/build/cjs/vexflow-core.js.map +1 -1
- package/build/cjs/vexflow-debug-with-tests.js +92 -24
- package/build/cjs/vexflow-debug-with-tests.js.map +1 -1
- package/build/cjs/vexflow-debug.js +38 -16
- package/build/cjs/vexflow-debug.js.map +1 -1
- package/build/cjs/vexflow-font-gonville.js +1 -1
- package/build/cjs/vexflow-font-gonville.js.map +1 -1
- package/build/cjs/vexflow-gonville.js +2 -2
- package/build/cjs/vexflow-gonville.js.map +1 -1
- package/build/cjs/vexflow-petaluma.js +2 -2
- package/build/cjs/vexflow-petaluma.js.map +1 -1
- package/build/cjs/vexflow.js +2 -2
- package/build/cjs/vexflow.js.map +1 -1
- package/build/esm/entry/vexflow-bravura.js +11 -0
- package/build/esm/entry/vexflow-core.js +54 -0
- package/build/esm/entry/vexflow-debug-with-tests.js +4 -0
- package/build/esm/entry/vexflow-debug.js +3 -0
- package/build/esm/entry/vexflow-font-bravura.js +7 -0
- package/build/esm/entry/vexflow-font-custom.js +7 -0
- package/build/esm/entry/vexflow-font-gonville.js +7 -0
- package/build/esm/entry/vexflow-font-petaluma.js +7 -0
- package/build/esm/entry/vexflow-gonville.js +11 -0
- package/build/esm/entry/vexflow-petaluma.js +11 -0
- package/build/esm/entry/vexflow.js +9 -0
- package/build/esm/src/accidental.js +348 -0
- package/build/esm/src/annotation.js +232 -0
- package/build/esm/src/articulation.js +267 -0
- package/build/esm/src/barnote.js +58 -0
- package/build/esm/src/beam.js +632 -0
- package/build/esm/src/bend.js +202 -0
- package/build/esm/src/boundingbox.js +59 -0
- package/build/esm/src/boundingboxcomputation.js +107 -0
- package/build/esm/src/canvascontext.js +202 -0
- package/build/esm/src/chordsymbol.js +578 -0
- package/build/esm/src/clef.js +153 -0
- package/build/esm/src/clefnote.js +65 -0
- package/build/esm/src/crescendo.js +77 -0
- package/build/esm/src/curve.js +118 -0
- package/build/esm/src/dot.js +137 -0
- package/build/esm/src/easyscore.js +374 -0
- package/build/esm/src/element.js +216 -0
- package/build/esm/src/factory.js +440 -0
- package/build/esm/src/flow.js +275 -0
- package/build/esm/src/font.js +264 -0
- package/build/esm/src/fonts/bravura_glyphs.js +3239 -0
- package/build/esm/src/fonts/bravura_metrics.js +507 -0
- package/build/esm/src/fonts/custom_glyphs.js +78 -0
- package/build/esm/src/fonts/custom_metrics.js +5 -0
- package/build/esm/src/fonts/gonville_glyphs.js +828 -0
- package/build/esm/src/fonts/gonville_metrics.js +421 -0
- package/build/esm/src/fonts/load_all.js +10 -0
- package/build/esm/src/fonts/load_bravura.js +6 -0
- package/build/esm/src/fonts/load_custom.js +6 -0
- package/build/esm/src/fonts/load_gonville.js +6 -0
- package/build/esm/src/fonts/load_petaluma.js +6 -0
- package/build/esm/src/fonts/petaluma_glyphs.js +1335 -0
- package/build/esm/src/fonts/petaluma_metrics.js +536 -0
- package/build/esm/src/fonts/petalumascript_glyphs.js +863 -0
- package/build/esm/src/fonts/robotoslab_glyphs.js +863 -0
- package/build/esm/src/fonts/textfonts.js +44 -0
- package/build/esm/src/formatter.js +568 -0
- package/build/esm/src/fraction.js +171 -0
- package/build/esm/src/frethandfinger.js +156 -0
- package/build/esm/src/ghostnote.js +50 -0
- package/build/esm/src/glyph.js +331 -0
- package/build/esm/src/glyphnote.js +55 -0
- package/build/esm/src/gracenote.js +133 -0
- package/build/esm/src/gracenotegroup.js +128 -0
- package/build/esm/src/gracetabnote.js +12 -0
- package/build/esm/src/index.js +91 -0
- package/build/esm/src/keymanager.js +99 -0
- package/build/esm/src/keysignature.js +250 -0
- package/build/esm/src/keysignote.js +28 -0
- package/build/esm/src/modifier.js +128 -0
- package/build/esm/src/modifiercontext.js +110 -0
- package/build/esm/src/multimeasurerest.js +173 -0
- package/build/esm/src/music.js +322 -0
- package/build/esm/src/note.js +371 -0
- package/build/esm/src/notehead.js +169 -0
- package/build/esm/src/notesubgroup.js +59 -0
- package/build/esm/src/ornament.js +206 -0
- package/build/esm/src/parenthesis.js +76 -0
- package/build/esm/src/parser.js +164 -0
- package/build/esm/src/pedalmarking.js +192 -0
- package/build/esm/src/registry.js +81 -0
- package/build/esm/src/rendercontext.js +24 -0
- package/build/esm/src/renderer.js +112 -0
- package/build/esm/src/repeatnote.js +22 -0
- package/build/esm/src/stave.js +547 -0
- package/build/esm/src/stavebarline.js +182 -0
- package/build/esm/src/staveconnector.js +196 -0
- package/build/esm/src/stavehairpin.js +120 -0
- package/build/esm/src/staveline.js +218 -0
- package/build/esm/src/stavemodifier.js +77 -0
- package/build/esm/src/stavenote.js +855 -0
- package/build/esm/src/staverepetition.js +155 -0
- package/build/esm/src/stavesection.js +58 -0
- package/build/esm/src/stavetempo.js +91 -0
- package/build/esm/src/stavetext.js +82 -0
- package/build/esm/src/stavetie.js +141 -0
- package/build/esm/src/stavevolta.js +67 -0
- package/build/esm/src/stem.js +131 -0
- package/build/esm/src/stemmablenote.js +193 -0
- package/build/esm/src/stringnumber.js +231 -0
- package/build/esm/src/strokes.js +200 -0
- package/build/esm/src/svgcontext.js +414 -0
- package/build/esm/src/system.js +116 -0
- package/build/esm/src/tables.js +1102 -0
- package/build/esm/src/tabnote.js +299 -0
- package/build/esm/src/tabslide.js +76 -0
- package/build/esm/src/tabstave.js +17 -0
- package/build/esm/src/tabtie.js +19 -0
- package/build/esm/src/textbracket.js +144 -0
- package/build/esm/src/textdynamics.js +81 -0
- package/build/esm/src/textformatter.js +177 -0
- package/build/esm/src/textnote.js +176 -0
- package/build/esm/src/tickable.js +214 -0
- package/build/esm/src/tickcontext.js +170 -0
- package/build/esm/src/timesigglyph.js +85 -0
- package/build/esm/src/timesignature.js +89 -0
- package/build/esm/src/timesignote.js +32 -0
- package/build/esm/src/tremolo.js +47 -0
- package/build/esm/src/tuning.js +54 -0
- package/build/esm/src/tuplet.js +240 -0
- package/build/esm/src/typeguard.js +30 -0
- package/build/esm/src/util.js +58 -0
- package/build/esm/src/version.js +3 -3
- package/build/esm/src/vex.js +51 -0
- package/build/esm/src/vibrato.js +100 -0
- package/build/esm/src/vibratobracket.js +50 -0
- package/build/esm/src/voice.js +187 -0
- package/build/esm/src/web.js +15 -0
- package/build/esm/tests/accidental_tests.js +974 -0
- package/build/esm/tests/annotation_tests.js +377 -0
- package/build/esm/tests/articulation_tests.js +365 -0
- package/build/esm/tests/auto_beam_formatting_tests.js +548 -0
- package/build/esm/tests/bach_tests.js +335 -0
- package/build/esm/tests/barline_tests.js +52 -0
- package/build/esm/tests/beam_tests.js +595 -0
- package/build/esm/tests/bend_tests.js +215 -0
- package/build/esm/tests/boundingbox_tests.js +53 -0
- package/build/esm/tests/boundingboxcomputation_tests.js +183 -0
- package/build/esm/tests/chordsymbol_tests.js +320 -0
- package/build/esm/tests/clef_tests.js +131 -0
- package/build/esm/tests/curve_tests.js +118 -0
- package/build/esm/tests/dot_tests.js +123 -0
- package/build/esm/tests/easyscore_tests.js +459 -0
- package/build/esm/tests/factory_tests.js +44 -0
- package/build/esm/tests/font_tests.js +135 -0
- package/build/esm/tests/formatter/framestack.js +61 -0
- package/build/esm/tests/formatter/tests.js +203 -0
- package/build/esm/tests/formatter_tests.js +669 -0
- package/build/esm/tests/fraction_tests.js +72 -0
- package/build/esm/tests/ghostnote_tests.js +77 -0
- package/build/esm/tests/glyphnote_tests.js +113 -0
- package/build/esm/tests/gracenote_tests.js +413 -0
- package/build/esm/tests/gracetabnote_tests.js +79 -0
- package/build/esm/tests/index.js +68 -0
- package/build/esm/tests/key_clef_tests.js +103 -0
- package/build/esm/tests/keymanager_tests.js +68 -0
- package/build/esm/tests/keysignature_tests.js +308 -0
- package/build/esm/tests/mocks.js +71 -0
- package/build/esm/tests/modifier_tests.js +24 -0
- package/build/esm/tests/multimeasurerest_tests.js +141 -0
- package/build/esm/tests/music_tests.js +161 -0
- package/build/esm/tests/notehead_tests.js +137 -0
- package/build/esm/tests/notesubgroup_tests.js +149 -0
- package/build/esm/tests/offscreencanvas_tests.js +47 -0
- package/build/esm/tests/ornament_tests.js +298 -0
- package/build/esm/tests/parser_tests.js +122 -0
- package/build/esm/tests/pedalmarking_tests.js +64 -0
- package/build/esm/tests/percussion_tests.js +180 -0
- package/build/esm/tests/registry_tests.js +64 -0
- package/build/esm/tests/renderer_tests.js +113 -0
- package/build/esm/tests/rests_tests.js +248 -0
- package/build/esm/tests/rhythm_tests.js +357 -0
- package/build/esm/tests/stave_tests.js +560 -0
- package/build/esm/tests/staveconnector_tests.js +402 -0
- package/build/esm/tests/stavehairpin_tests.js +90 -0
- package/build/esm/tests/staveline_tests.js +122 -0
- package/build/esm/tests/stavemodifier_tests.js +51 -0
- package/build/esm/tests/stavenote_tests.js +867 -0
- package/build/esm/tests/stavetie_tests.js +108 -0
- package/build/esm/tests/stringnumber_tests.js +259 -0
- package/build/esm/tests/strokes_tests.js +275 -0
- package/build/esm/tests/style_tests.js +98 -0
- package/build/esm/tests/support/qunit.js +2765 -0
- package/build/esm/tests/tabnote_tests.js +474 -0
- package/build/esm/tests/tabslide_tests.js +135 -0
- package/build/esm/tests/tabstave_tests.js +23 -0
- package/build/esm/tests/tabtie_tests.js +173 -0
- package/build/esm/tests/textbracket_tests.js +100 -0
- package/build/esm/tests/textformatter_tests.js +24 -0
- package/build/esm/tests/textnote_tests.js +215 -0
- package/build/esm/tests/threevoice_tests.js +132 -0
- package/build/esm/tests/tickcontext_tests.js +36 -0
- package/build/esm/tests/timesignature_tests.js +134 -0
- package/build/esm/tests/tremolo_tests.js +75 -0
- package/build/esm/tests/tuning_tests.js +56 -0
- package/build/esm/tests/tuplet_tests.js +450 -0
- package/build/esm/tests/typeguard_tests.js +82 -0
- package/build/esm/tests/vexflow_test_helpers.js +266 -0
- package/build/esm/tests/vf_prefix_tests.js +115 -0
- package/build/esm/tests/vibrato_tests.js +92 -0
- package/build/esm/tests/vibratobracket_tests.js +45 -0
- package/build/esm/tests/voice_tests.js +69 -0
- package/build/types/entry/vexflow-bravura.d.ts +3 -0
- package/build/types/entry/vexflow-core.d.ts +3 -0
- package/build/types/entry/vexflow-debug.d.ts +3 -0
- package/build/types/entry/vexflow-font-bravura.d.ts +3771 -0
- package/build/types/entry/vexflow-font-custom.d.ts +86 -0
- package/build/types/entry/vexflow-font-gonville.d.ts +1267 -0
- package/build/types/entry/vexflow-font-petaluma.d.ts +1896 -0
- package/build/types/entry/vexflow-gonville.d.ts +3 -0
- package/build/types/entry/vexflow-petaluma.d.ts +3 -0
- package/build/types/entry/vexflow.d.ts +3 -0
- package/build/types/src/accidental.d.ts +66 -0
- package/build/types/src/annotation.d.ts +60 -0
- package/build/types/src/articulation.d.ts +62 -0
- package/build/types/src/barnote.d.ts +29 -0
- package/build/types/src/beam.d.ts +124 -0
- package/build/types/src/bend.d.ts +73 -0
- package/build/types/src/boundingbox.d.ts +42 -0
- package/build/types/src/boundingboxcomputation.d.ts +33 -0
- package/build/types/src/canvascontext.d.ts +89 -0
- package/build/types/src/chordsymbol.d.ts +149 -0
- package/build/types/src/clef.d.ts +48 -0
- package/build/types/src/clefnote.d.ts +25 -0
- package/build/types/src/crescendo.d.ts +27 -0
- package/build/types/src/curve.d.ts +41 -0
- package/build/types/src/dot.d.ts +20 -0
- package/build/types/src/easyscore.d.ts +148 -0
- package/build/types/src/element.d.ts +202 -0
- package/build/types/src/factory.d.ts +271 -0
- package/build/types/src/flow.d.ts +245 -0
- package/build/types/src/font.d.ts +181 -0
- package/build/types/src/fonts/bravura_glyphs.d.ts +3239 -0
- package/build/types/src/fonts/bravura_metrics.d.ts +533 -0
- package/build/types/src/fonts/custom_glyphs.d.ts +78 -0
- package/build/types/src/fonts/custom_metrics.d.ts +5 -0
- package/build/types/src/fonts/gonville_glyphs.d.ts +828 -0
- package/build/types/src/fonts/gonville_metrics.d.ts +440 -0
- package/build/types/src/fonts/load_all.d.ts +1 -0
- package/build/types/src/fonts/load_bravura.d.ts +1 -0
- package/build/types/src/fonts/load_custom.d.ts +1 -0
- package/build/types/src/fonts/load_gonville.d.ts +1 -0
- package/build/types/src/fonts/load_petaluma.d.ts +1 -0
- package/build/types/src/fonts/petaluma_glyphs.d.ts +1335 -0
- package/build/types/src/fonts/petaluma_metrics.d.ts +562 -0
- package/build/types/src/fonts/petalumascript_glyphs.d.ts +863 -0
- package/build/types/src/fonts/robotoslab_glyphs.d.ts +863 -0
- package/build/types/src/fonts/textfonts.d.ts +1 -0
- package/build/types/src/formatter.d.ts +203 -0
- package/build/types/src/fraction.d.ts +62 -0
- package/build/types/src/frethandfinger.d.ts +22 -0
- package/build/types/src/ghostnote.d.ts +16 -0
- package/build/types/src/glyph.d.ts +139 -0
- package/build/types/src/glyphnote.d.ts +17 -0
- package/build/types/src/gracenote.d.ts +19 -0
- package/build/types/src/gracenotegroup.d.ts +33 -0
- package/build/types/src/gracetabnote.d.ts +5 -0
- package/build/types/src/index.d.ts +91 -0
- package/build/types/src/keymanager.d.ts +25 -0
- package/build/types/src/keysignature.d.ts +50 -0
- package/build/types/src/keysignote.d.ts +11 -0
- package/build/types/src/modifier.d.ts +97 -0
- package/build/types/src/modifiercontext.d.ts +45 -0
- package/build/types/src/multimeasurerest.d.ts +61 -0
- package/build/types/src/music.d.ts +91 -0
- package/build/types/src/note.d.ts +231 -0
- package/build/types/src/notehead.d.ts +70 -0
- package/build/types/src/notesubgroup.d.ts +18 -0
- package/build/types/src/ornament.d.ts +76 -0
- package/build/types/src/parenthesis.d.ts +22 -0
- package/build/types/src/parser.d.ts +45 -0
- package/build/types/src/pedalmarking.d.ts +69 -0
- package/build/types/src/registry.d.ts +40 -0
- package/build/types/src/rendercontext.d.ts +64 -0
- package/build/types/src/renderer.d.ts +35 -0
- package/build/types/src/repeatnote.d.ts +6 -0
- package/build/types/src/stave.d.ts +186 -0
- package/build/types/src/stavebarline.d.ts +28 -0
- package/build/types/src/staveconnector.d.ts +67 -0
- package/build/types/src/stavehairpin.d.ts +56 -0
- package/build/types/src/staveline.d.ts +57 -0
- package/build/types/src/stavemodifier.d.ts +44 -0
- package/build/types/src/stavenote.d.ts +154 -0
- package/build/types/src/staverepetition.d.ts +32 -0
- package/build/types/src/stavesection.d.ts +15 -0
- package/build/types/src/stavetempo.d.ts +25 -0
- package/build/types/src/stavetext.d.ts +25 -0
- package/build/types/src/stavetie.d.ts +59 -0
- package/build/types/src/stavevolta.d.ts +21 -0
- package/build/types/src/stem.d.ts +58 -0
- package/build/types/src/stemmablenote.d.ts +39 -0
- package/build/types/src/stringnumber.d.ts +27 -0
- package/build/types/src/strokes.d.ts +33 -0
- package/build/types/src/svgcontext.d.ts +131 -0
- package/build/types/src/system.d.ts +92 -0
- package/build/types/src/tables.d.ts +96 -0
- package/build/types/src/tabnote.d.ts +44 -0
- package/build/types/src/tabslide.d.ts +34 -0
- package/build/types/src/tabstave.d.ts +7 -0
- package/build/types/src/tabtie.d.ts +18 -0
- package/build/types/src/textbracket.d.ts +55 -0
- package/build/types/src/textdynamics.d.ts +39 -0
- package/build/types/src/textformatter.d.ts +109 -0
- package/build/types/src/textnote.d.ts +49 -0
- package/build/types/src/tickable.d.ts +140 -0
- package/build/types/src/tickcontext.d.ts +82 -0
- package/build/types/src/timesigglyph.d.ts +14 -0
- package/build/types/src/timesignature.d.ts +26 -0
- package/build/types/src/timesignote.d.ts +11 -0
- package/build/types/src/tremolo.d.ts +17 -0
- package/build/types/src/tuning.d.ts +23 -0
- package/build/types/src/tuplet.d.ts +105 -0
- package/build/types/src/typeguard.d.ts +99 -0
- package/build/types/src/util.d.ts +27 -0
- package/build/types/src/version.d.ts +3 -0
- package/build/types/src/vex.d.ts +18 -0
- package/build/types/src/vibrato.d.ts +29 -0
- package/build/types/src/vibratobracket.d.ts +33 -0
- package/build/types/src/voice.d.ts +108 -0
- package/build/types/src/web.d.ts +2 -0
- package/package.json +1 -1
- package/src/annotation.ts +27 -6
- package/src/articulation.ts +8 -2
- package/src/fonts/gonville_glyphs.ts +4 -4
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Element } from './element.js';
|
|
2
|
+
import { Modifier } from './modifier.js';
|
|
3
|
+
import { TextFormatter } from './textformatter.js';
|
|
4
|
+
import { isTabNote } from './typeguard.js';
|
|
5
|
+
import { RuntimeError } from './util.js';
|
|
6
|
+
export class Bend extends Modifier {
|
|
7
|
+
constructor(text, release = false, phrase) {
|
|
8
|
+
super();
|
|
9
|
+
this.text = text;
|
|
10
|
+
this.x_shift = 0;
|
|
11
|
+
this.release = release;
|
|
12
|
+
this.tap = '';
|
|
13
|
+
this.resetFont();
|
|
14
|
+
this.render_options = {
|
|
15
|
+
line_width: 1.5,
|
|
16
|
+
line_style: '#777777',
|
|
17
|
+
bend_width: 8,
|
|
18
|
+
release_width: 8,
|
|
19
|
+
};
|
|
20
|
+
if (phrase) {
|
|
21
|
+
this.phrase = phrase;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.phrase = [{ type: Bend.UP, text: this.text }];
|
|
25
|
+
if (this.release)
|
|
26
|
+
this.phrase.push({ type: Bend.DOWN, text: '' });
|
|
27
|
+
}
|
|
28
|
+
this.updateWidth();
|
|
29
|
+
}
|
|
30
|
+
static get CATEGORY() {
|
|
31
|
+
return "Bend";
|
|
32
|
+
}
|
|
33
|
+
static get UP() {
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
static get DOWN() {
|
|
37
|
+
return 1;
|
|
38
|
+
}
|
|
39
|
+
static format(bends, state) {
|
|
40
|
+
if (!bends || bends.length === 0)
|
|
41
|
+
return false;
|
|
42
|
+
let last_width = 0;
|
|
43
|
+
for (let i = 0; i < bends.length; ++i) {
|
|
44
|
+
const bend = bends[i];
|
|
45
|
+
const note = bend.checkAttachedNote();
|
|
46
|
+
if (isTabNote(note)) {
|
|
47
|
+
const stringPos = note.leastString() - 1;
|
|
48
|
+
if (state.top_text_line < stringPos) {
|
|
49
|
+
state.top_text_line = stringPos;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
bend.setXShift(last_width);
|
|
53
|
+
last_width = bend.getWidth();
|
|
54
|
+
bend.setTextLine(state.top_text_line);
|
|
55
|
+
}
|
|
56
|
+
state.right_shift += last_width;
|
|
57
|
+
state.top_text_line += 1;
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
setXShift(value) {
|
|
61
|
+
this.x_shift = value;
|
|
62
|
+
this.updateWidth();
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
setTap(value) {
|
|
66
|
+
this.tap = value;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
getText() {
|
|
70
|
+
return this.text;
|
|
71
|
+
}
|
|
72
|
+
getTextHeight() {
|
|
73
|
+
const textFormatter = TextFormatter.create(this.textFont);
|
|
74
|
+
return textFormatter.maxHeight;
|
|
75
|
+
}
|
|
76
|
+
updateWidth() {
|
|
77
|
+
const textFormatter = TextFormatter.create(this.textFont);
|
|
78
|
+
const measureText = (text) => {
|
|
79
|
+
return textFormatter.getWidthForTextInPx(text);
|
|
80
|
+
};
|
|
81
|
+
let totalWidth = 0;
|
|
82
|
+
for (let i = 0; i < this.phrase.length; ++i) {
|
|
83
|
+
const bend = this.phrase[i];
|
|
84
|
+
if (bend.width !== undefined) {
|
|
85
|
+
totalWidth += bend.width;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const additional_width = bend.type === Bend.UP ? this.render_options.bend_width : this.render_options.release_width;
|
|
89
|
+
bend.width = Math.max(additional_width, measureText(bend.text)) + 3;
|
|
90
|
+
bend.draw_width = bend.width / 2;
|
|
91
|
+
totalWidth += bend.width;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
this.setWidth(totalWidth + this.x_shift);
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
draw() {
|
|
98
|
+
var _a;
|
|
99
|
+
const ctx = this.checkContext();
|
|
100
|
+
const note = this.checkAttachedNote();
|
|
101
|
+
this.setRendered();
|
|
102
|
+
const start = note.getModifierStartXY(Modifier.Position.RIGHT, this.index);
|
|
103
|
+
start.x += 3;
|
|
104
|
+
start.y += 0.5;
|
|
105
|
+
const x_shift = this.x_shift;
|
|
106
|
+
const stave = note.checkStave();
|
|
107
|
+
const spacing = stave.getSpacingBetweenLines();
|
|
108
|
+
const lowestY = note.getYs().reduce((a, b) => (a < b ? a : b));
|
|
109
|
+
const bend_height = start.y - ((this.text_line + 1) * spacing + start.y - lowestY) + 3;
|
|
110
|
+
const annotation_y = start.y - ((this.text_line + 1) * spacing + start.y - lowestY) - 1;
|
|
111
|
+
const renderBend = (x, y, width, height) => {
|
|
112
|
+
const cp_x = x + width;
|
|
113
|
+
const cp_y = y;
|
|
114
|
+
ctx.save();
|
|
115
|
+
ctx.beginPath();
|
|
116
|
+
ctx.setLineWidth(this.render_options.line_width);
|
|
117
|
+
ctx.setStrokeStyle(this.render_options.line_style);
|
|
118
|
+
ctx.setFillStyle(this.render_options.line_style);
|
|
119
|
+
ctx.moveTo(x, y);
|
|
120
|
+
ctx.quadraticCurveTo(cp_x, cp_y, x + width, height);
|
|
121
|
+
ctx.stroke();
|
|
122
|
+
ctx.restore();
|
|
123
|
+
};
|
|
124
|
+
const renderRelease = (x, y, width, height) => {
|
|
125
|
+
ctx.save();
|
|
126
|
+
ctx.beginPath();
|
|
127
|
+
ctx.setLineWidth(this.render_options.line_width);
|
|
128
|
+
ctx.setStrokeStyle(this.render_options.line_style);
|
|
129
|
+
ctx.setFillStyle(this.render_options.line_style);
|
|
130
|
+
ctx.moveTo(x, height);
|
|
131
|
+
ctx.quadraticCurveTo(x + width, height, x + width, y);
|
|
132
|
+
ctx.stroke();
|
|
133
|
+
ctx.restore();
|
|
134
|
+
};
|
|
135
|
+
const renderArrowHead = (x, y, direction) => {
|
|
136
|
+
const width = 4;
|
|
137
|
+
const yBase = y + width * direction;
|
|
138
|
+
ctx.beginPath();
|
|
139
|
+
ctx.moveTo(x, y);
|
|
140
|
+
ctx.lineTo(x - width, yBase);
|
|
141
|
+
ctx.lineTo(x + width, yBase);
|
|
142
|
+
ctx.closePath();
|
|
143
|
+
ctx.fill();
|
|
144
|
+
};
|
|
145
|
+
const renderText = (x, text) => {
|
|
146
|
+
ctx.save();
|
|
147
|
+
ctx.setFont(this.textFont);
|
|
148
|
+
const render_x = x - ctx.measureText(text).width / 2;
|
|
149
|
+
ctx.fillText(text, render_x, annotation_y);
|
|
150
|
+
ctx.restore();
|
|
151
|
+
};
|
|
152
|
+
let last_bend = undefined;
|
|
153
|
+
let last_bend_draw_width = 0;
|
|
154
|
+
let last_drawn_width = 0;
|
|
155
|
+
if ((_a = this.tap) === null || _a === void 0 ? void 0 : _a.length) {
|
|
156
|
+
const tapStart = note.getModifierStartXY(Modifier.Position.CENTER, this.index);
|
|
157
|
+
renderText(tapStart.x, this.tap);
|
|
158
|
+
}
|
|
159
|
+
for (let i = 0; i < this.phrase.length; ++i) {
|
|
160
|
+
const bend = this.phrase[i];
|
|
161
|
+
if (!bend.draw_width)
|
|
162
|
+
bend.draw_width = 0;
|
|
163
|
+
if (i === 0)
|
|
164
|
+
bend.draw_width += x_shift;
|
|
165
|
+
last_drawn_width = bend.draw_width + last_bend_draw_width - (i === 1 ? x_shift : 0);
|
|
166
|
+
if (bend.type === Bend.UP) {
|
|
167
|
+
if (last_bend && last_bend.type === Bend.UP) {
|
|
168
|
+
renderArrowHead(start.x, bend_height, +1);
|
|
169
|
+
}
|
|
170
|
+
renderBend(start.x, start.y, last_drawn_width, bend_height);
|
|
171
|
+
}
|
|
172
|
+
if (bend.type === Bend.DOWN) {
|
|
173
|
+
if (last_bend && last_bend.type === Bend.UP) {
|
|
174
|
+
renderRelease(start.x, start.y, last_drawn_width, bend_height);
|
|
175
|
+
}
|
|
176
|
+
if (last_bend && last_bend.type === Bend.DOWN) {
|
|
177
|
+
renderArrowHead(start.x, start.y, -1);
|
|
178
|
+
renderRelease(start.x, start.y, last_drawn_width, bend_height);
|
|
179
|
+
}
|
|
180
|
+
if (!last_bend) {
|
|
181
|
+
last_drawn_width = bend.draw_width;
|
|
182
|
+
renderRelease(start.x, start.y, last_drawn_width, bend_height);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
renderText(start.x + last_drawn_width, bend.text);
|
|
186
|
+
last_bend = bend;
|
|
187
|
+
last_bend_draw_width = bend.draw_width;
|
|
188
|
+
last_bend.x = start.x;
|
|
189
|
+
start.x += last_drawn_width;
|
|
190
|
+
}
|
|
191
|
+
if (!last_bend || last_bend.x == undefined) {
|
|
192
|
+
throw new RuntimeError('NoLastBendForBend', 'Internal error.');
|
|
193
|
+
}
|
|
194
|
+
if (last_bend.type === Bend.UP) {
|
|
195
|
+
renderArrowHead(last_bend.x + last_drawn_width, bend_height, +1);
|
|
196
|
+
}
|
|
197
|
+
else if (last_bend.type === Bend.DOWN) {
|
|
198
|
+
renderArrowHead(last_bend.x + last_drawn_width, start.y, -1);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
Bend.TEXT_FONT = Object.assign({}, Element.TEXT_FONT);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export class BoundingBox {
|
|
2
|
+
constructor(x, y, w, h) {
|
|
3
|
+
this.x = x;
|
|
4
|
+
this.y = y;
|
|
5
|
+
this.w = w;
|
|
6
|
+
this.h = h;
|
|
7
|
+
}
|
|
8
|
+
static copy(that) {
|
|
9
|
+
return new BoundingBox(that.x, that.y, that.w, that.h);
|
|
10
|
+
}
|
|
11
|
+
getX() {
|
|
12
|
+
return this.x;
|
|
13
|
+
}
|
|
14
|
+
getY() {
|
|
15
|
+
return this.y;
|
|
16
|
+
}
|
|
17
|
+
getW() {
|
|
18
|
+
return this.w;
|
|
19
|
+
}
|
|
20
|
+
getH() {
|
|
21
|
+
return this.h;
|
|
22
|
+
}
|
|
23
|
+
setX(x) {
|
|
24
|
+
this.x = x;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
setY(y) {
|
|
28
|
+
this.y = y;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
setW(w) {
|
|
32
|
+
this.w = w;
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
setH(h) {
|
|
36
|
+
this.h = h;
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
move(x, y) {
|
|
40
|
+
this.x += x;
|
|
41
|
+
this.y += y;
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
clone() {
|
|
45
|
+
return BoundingBox.copy(this);
|
|
46
|
+
}
|
|
47
|
+
mergeWith(boundingBox) {
|
|
48
|
+
const that = boundingBox;
|
|
49
|
+
const new_x = this.x < that.x ? this.x : that.x;
|
|
50
|
+
const new_y = this.y < that.y ? this.y : that.y;
|
|
51
|
+
const new_w = Math.max(this.x + this.w, that.x + that.w) - new_x;
|
|
52
|
+
const new_h = Math.max(this.y + this.h, that.y + that.h) - new_y;
|
|
53
|
+
this.x = new_x;
|
|
54
|
+
this.y = new_y;
|
|
55
|
+
this.w = new_w;
|
|
56
|
+
this.h = new_h;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export class BoundingBoxComputation {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.x1 = Number.NaN;
|
|
4
|
+
this.y1 = Number.NaN;
|
|
5
|
+
this.x2 = Number.NaN;
|
|
6
|
+
this.y2 = Number.NaN;
|
|
7
|
+
}
|
|
8
|
+
getX1() {
|
|
9
|
+
return this.x1;
|
|
10
|
+
}
|
|
11
|
+
getY1() {
|
|
12
|
+
return this.y1;
|
|
13
|
+
}
|
|
14
|
+
width() {
|
|
15
|
+
return this.x2 - this.x1;
|
|
16
|
+
}
|
|
17
|
+
height() {
|
|
18
|
+
return this.y2 - this.y1;
|
|
19
|
+
}
|
|
20
|
+
addPoint(x, y) {
|
|
21
|
+
if (isNaN(this.x1) || x < this.x1)
|
|
22
|
+
this.x1 = x;
|
|
23
|
+
if (isNaN(this.x2) || x > this.x2)
|
|
24
|
+
this.x2 = x;
|
|
25
|
+
if (isNaN(this.y1) || y < this.y1)
|
|
26
|
+
this.y1 = y;
|
|
27
|
+
if (isNaN(this.y2) || y > this.y2)
|
|
28
|
+
this.y2 = y;
|
|
29
|
+
}
|
|
30
|
+
addX(x) {
|
|
31
|
+
this.addPoint(x, this.y1);
|
|
32
|
+
}
|
|
33
|
+
addY(y) {
|
|
34
|
+
this.addPoint(this.x1, y);
|
|
35
|
+
}
|
|
36
|
+
addQuadraticCurve(p0x, p0y, p1x, p1y, p2x, p2y) {
|
|
37
|
+
this.addPoint(p0x, p0y);
|
|
38
|
+
this.addPoint(p2x, p2y);
|
|
39
|
+
const p01x = p1x - p0x;
|
|
40
|
+
const p12x = p2x - p1x;
|
|
41
|
+
let denom = p01x - p12x;
|
|
42
|
+
if (denom != 0) {
|
|
43
|
+
const t = p01x / denom;
|
|
44
|
+
if (t > 0 && t < 1) {
|
|
45
|
+
const it = 1 - t;
|
|
46
|
+
this.addX(it * it * p0x + 2 * it * t * p1x + t * t * p2x);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const p01y = p1y - p0y;
|
|
50
|
+
const p12y = p2y - p1y;
|
|
51
|
+
denom = p01y - p12y;
|
|
52
|
+
if (denom != 0) {
|
|
53
|
+
const t = p01y / denom;
|
|
54
|
+
if (t > 0 && t < 1) {
|
|
55
|
+
const it = 1 - t;
|
|
56
|
+
this.addY(it * it * p0y + 2 * it * t * p1y + t * t * p2y);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
addBezierCurve(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
|
|
61
|
+
const p0 = [p0x, p0y];
|
|
62
|
+
const p1 = [p1x, p1y];
|
|
63
|
+
const p2 = [p2x, p2y];
|
|
64
|
+
const p3 = [p3x, p3y];
|
|
65
|
+
let i;
|
|
66
|
+
this.addPoint(p0[0], p0[1]);
|
|
67
|
+
this.addPoint(p3[0], p3[1]);
|
|
68
|
+
const f = (t, i) => Math.pow(1 - t, 3) * p0[i] +
|
|
69
|
+
3 * Math.pow(1 - t, 2) * t * p1[i] +
|
|
70
|
+
3 * (1 - t) * Math.pow(t, 2) * p2[i] +
|
|
71
|
+
Math.pow(t, 3) * p3[i];
|
|
72
|
+
for (i = 0; i <= 1; i++) {
|
|
73
|
+
const b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i];
|
|
74
|
+
const a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i];
|
|
75
|
+
const c = 3 * p1[i] - 3 * p0[i];
|
|
76
|
+
if (a === 0) {
|
|
77
|
+
if (b === 0)
|
|
78
|
+
continue;
|
|
79
|
+
const t = -c / b;
|
|
80
|
+
if (0 < t && t < 1) {
|
|
81
|
+
if (i === 0)
|
|
82
|
+
this.addX(f(t, i));
|
|
83
|
+
if (i === 1)
|
|
84
|
+
this.addY(f(t, i));
|
|
85
|
+
}
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const b2ac = Math.pow(b, 2) - 4 * c * a;
|
|
89
|
+
if (b2ac < 0)
|
|
90
|
+
continue;
|
|
91
|
+
const t1 = (-b + Math.sqrt(b2ac)) / (2 * a);
|
|
92
|
+
if (0 < t1 && t1 < 1) {
|
|
93
|
+
if (i === 0)
|
|
94
|
+
this.addX(f(t1, i));
|
|
95
|
+
if (i === 1)
|
|
96
|
+
this.addY(f(t1, i));
|
|
97
|
+
}
|
|
98
|
+
const t2 = (-b - Math.sqrt(b2ac)) / (2 * a);
|
|
99
|
+
if (0 < t2 && t2 < 1) {
|
|
100
|
+
if (i === 0)
|
|
101
|
+
this.addX(f(t2, i));
|
|
102
|
+
if (i === 1)
|
|
103
|
+
this.addY(f(t2, i));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Font } from './font.js';
|
|
2
|
+
import { RenderContext } from './rendercontext.js';
|
|
3
|
+
import { globalObject, warn } from './util.js';
|
|
4
|
+
import { isHTMLCanvas } from './web.js';
|
|
5
|
+
export class CanvasContext extends RenderContext {
|
|
6
|
+
constructor(context) {
|
|
7
|
+
super();
|
|
8
|
+
this.textHeight = 0;
|
|
9
|
+
this.context2D = context;
|
|
10
|
+
if (!context.canvas) {
|
|
11
|
+
this.canvas = {
|
|
12
|
+
width: CanvasContext.WIDTH,
|
|
13
|
+
height: CanvasContext.HEIGHT,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
this.canvas = context.canvas;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
static get WIDTH() {
|
|
21
|
+
return 600;
|
|
22
|
+
}
|
|
23
|
+
static get HEIGHT() {
|
|
24
|
+
return 400;
|
|
25
|
+
}
|
|
26
|
+
static get CANVAS_BROWSER_SIZE_LIMIT() {
|
|
27
|
+
return 32767;
|
|
28
|
+
}
|
|
29
|
+
static sanitizeCanvasDims(width, height) {
|
|
30
|
+
const limit = this.CANVAS_BROWSER_SIZE_LIMIT;
|
|
31
|
+
if (Math.max(width, height) > limit) {
|
|
32
|
+
warn('Canvas dimensions exceed browser limit. Cropping to ' + limit);
|
|
33
|
+
if (width > limit) {
|
|
34
|
+
width = limit;
|
|
35
|
+
}
|
|
36
|
+
if (height > limit) {
|
|
37
|
+
height = limit;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return [width, height];
|
|
41
|
+
}
|
|
42
|
+
clear() {
|
|
43
|
+
this.context2D.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
44
|
+
}
|
|
45
|
+
openGroup(cls, id, attrs) {
|
|
46
|
+
}
|
|
47
|
+
closeGroup() {
|
|
48
|
+
}
|
|
49
|
+
add(child) {
|
|
50
|
+
}
|
|
51
|
+
setFillStyle(style) {
|
|
52
|
+
this.context2D.fillStyle = style;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
setBackgroundFillStyle(style) {
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
setStrokeStyle(style) {
|
|
59
|
+
this.context2D.strokeStyle = style;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
setShadowColor(color) {
|
|
63
|
+
this.context2D.shadowColor = color;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
setShadowBlur(blur) {
|
|
67
|
+
const t = this.context2D.getTransform();
|
|
68
|
+
const scale = Math.sqrt(t.a * t.a + t.b * t.b + t.c * t.c + t.d * t.d);
|
|
69
|
+
this.context2D.shadowBlur = scale * blur;
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
setLineWidth(width) {
|
|
73
|
+
this.context2D.lineWidth = width;
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
setLineCap(capType) {
|
|
77
|
+
this.context2D.lineCap = capType;
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
setLineDash(dash) {
|
|
81
|
+
this.context2D.setLineDash(dash);
|
|
82
|
+
return this;
|
|
83
|
+
}
|
|
84
|
+
scale(x, y) {
|
|
85
|
+
this.context2D.scale(x, y);
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
resize(width, height) {
|
|
89
|
+
const canvas = this.context2D.canvas;
|
|
90
|
+
const devicePixelRatio = globalObject().devicePixelRatio || 1;
|
|
91
|
+
[width, height] = CanvasContext.sanitizeCanvasDims(width * devicePixelRatio, height * devicePixelRatio);
|
|
92
|
+
width = (width / devicePixelRatio) | 0;
|
|
93
|
+
height = (height / devicePixelRatio) | 0;
|
|
94
|
+
canvas.width = width * devicePixelRatio;
|
|
95
|
+
canvas.height = height * devicePixelRatio;
|
|
96
|
+
if (isHTMLCanvas(canvas)) {
|
|
97
|
+
canvas.style.width = width + 'px';
|
|
98
|
+
canvas.style.height = height + 'px';
|
|
99
|
+
}
|
|
100
|
+
return this.scale(devicePixelRatio, devicePixelRatio);
|
|
101
|
+
}
|
|
102
|
+
rect(x, y, width, height) {
|
|
103
|
+
this.context2D.rect(x, y, width, height);
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
fillRect(x, y, width, height) {
|
|
107
|
+
this.context2D.fillRect(x, y, width, height);
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
clearRect(x, y, width, height) {
|
|
111
|
+
this.context2D.clearRect(x, y, width, height);
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
beginPath() {
|
|
115
|
+
this.context2D.beginPath();
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
moveTo(x, y) {
|
|
119
|
+
this.context2D.moveTo(x, y);
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
lineTo(x, y) {
|
|
123
|
+
this.context2D.lineTo(x, y);
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y) {
|
|
127
|
+
this.context2D.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
quadraticCurveTo(cpx, cpy, x, y) {
|
|
131
|
+
this.context2D.quadraticCurveTo(cpx, cpy, x, y);
|
|
132
|
+
return this;
|
|
133
|
+
}
|
|
134
|
+
arc(x, y, radius, startAngle, endAngle, counterclockwise) {
|
|
135
|
+
this.context2D.arc(x, y, radius, startAngle, endAngle, counterclockwise);
|
|
136
|
+
return this;
|
|
137
|
+
}
|
|
138
|
+
fill() {
|
|
139
|
+
this.context2D.fill();
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
stroke() {
|
|
143
|
+
this.context2D.stroke();
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
closePath() {
|
|
147
|
+
this.context2D.closePath();
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
measureText(text) {
|
|
151
|
+
const metrics = this.context2D.measureText(text);
|
|
152
|
+
let y = 0;
|
|
153
|
+
let height = 0;
|
|
154
|
+
if (metrics.fontBoundingBoxAscent) {
|
|
155
|
+
y = -metrics.fontBoundingBoxAscent;
|
|
156
|
+
height = metrics.fontBoundingBoxDescent + metrics.fontBoundingBoxAscent;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
y = -metrics.actualBoundingBoxAscent;
|
|
160
|
+
height = metrics.actualBoundingBoxDescent + metrics.actualBoundingBoxAscent;
|
|
161
|
+
}
|
|
162
|
+
return {
|
|
163
|
+
x: 0,
|
|
164
|
+
y: y,
|
|
165
|
+
width: metrics.width,
|
|
166
|
+
height: height,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
fillText(text, x, y) {
|
|
170
|
+
this.context2D.fillText(text, x, y);
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
save() {
|
|
174
|
+
this.context2D.save();
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
restore() {
|
|
178
|
+
this.context2D.restore();
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
set fillStyle(style) {
|
|
182
|
+
this.context2D.fillStyle = style;
|
|
183
|
+
}
|
|
184
|
+
get fillStyle() {
|
|
185
|
+
return this.context2D.fillStyle;
|
|
186
|
+
}
|
|
187
|
+
set strokeStyle(style) {
|
|
188
|
+
this.context2D.strokeStyle = style;
|
|
189
|
+
}
|
|
190
|
+
get strokeStyle() {
|
|
191
|
+
return this.context2D.strokeStyle;
|
|
192
|
+
}
|
|
193
|
+
setFont(f, size, weight, style) {
|
|
194
|
+
const fontInfo = Font.validate(f, size, weight, style);
|
|
195
|
+
this.context2D.font = Font.toCSSString(fontInfo);
|
|
196
|
+
this.textHeight = Font.convertSizeToPixelValue(fontInfo.size);
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
getFont() {
|
|
200
|
+
return this.context2D.font;
|
|
201
|
+
}
|
|
202
|
+
}
|