🤖 Merge PR #45811 [vexflow] feat: add optional Formatter constructor options by @sschmidTU

update vexflow version number in comment

Co-authored-by: sschmid <s.schmid@phonicscore.com>
This commit is contained in:
Simon 2020-07-06 21:09:28 +02:00 committed by GitHub
parent 47b4a51efb
commit 5ebf3ddd96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for VexFlow v1.2.88
// Type definitions for VexFlow v3.0.9
// Project: http://vexflow.com
// Definitions by: Roman Quiring <https://github.com/rquiring>
// Sebastian Haas <https://github.com/sebastianhaas>
@ -570,6 +570,10 @@ declare namespace Vex {
class Formatter {
static DEBUG: boolean;
constructor(options?: {
softmaxFactor?: number,
maxIterations?: number
});
static FormatAndDraw(
ctx: IRenderContext,
stave: Stave,

View File

@ -46,7 +46,8 @@ var voice2 = new Vex.Flow.Voice(Vex.Flow.TIME4_4).addTickables([
]);
// Format and justify the notes to 550 pixels
var formatter = new Vex.Flow.Formatter().joinVoices([voice1, voice2]).format([voice1, voice2], 550);
var formatter = new Vex.Flow.Formatter({softmaxFactor: null, maxIterations: 2})
.joinVoices([voice1, voice2]).format([voice1, voice2], 550);
// Render stave
stave.draw();