UNPKG

vexflow

Version:

A JavaScript library for rendering music notation and guitar tablature.

71 lines (70 loc) 1.45 kB
import { Fraction } from '../src/fraction.js'; import { Tickable } from '../src/tickable.js'; class MockTickable extends Tickable { constructor() { super(...arguments); this.ticks = new Fraction(1, 1); this.ignoreTicks = false; } init() { } getX() { return this.tickContext.getX(); } getIntrinsicTicks() { return this.ticks.value(); } getTicks() { return this.ticks; } setTicks(t) { this.ticks = new Fraction(t, 1); return this; } getMetrics() { return { width: 0, glyphWidth: 0, notePx: this.width, modLeftPx: 0, modRightPx: 0, leftDisplacedHeadPx: 0, rightDisplacedHeadPx: 0, glyphPx: 0, }; } getWidth() { return this.width; } setWidth(w) { this.width = w; return this; } setVoice(v) { this.voice = v; return this; } setStave(stave) { this.stave = stave; return this; } getStave() { return this.stave; } setTickContext(tc) { this.tickContext = tc; return this; } setIgnoreTicks(flag) { this.ignoreTicks = flag; return this; } shouldIgnoreTicks() { return this.ignoreTicks; } preFormat() { } draw(...args) { } } export { MockTickable };