|
@@ -155,17 +155,24 @@ export class VexFlowGraphicalSymbolFactory implements IGraphicalSymbolFactory {
|
|
|
* @param graphicalStaffEntry
|
|
|
* @param transposeHalftones
|
|
|
*/
|
|
|
- public createChordSymbol(sourceStaffEntry: SourceStaffEntry, graphicalStaffEntry: GraphicalStaffEntry, transposeHalftones: number): void {
|
|
|
- const graphicalChordSymbolContainer: GraphicalChordSymbolContainer =
|
|
|
- new GraphicalChordSymbolContainer(sourceStaffEntry.ChordContainer,
|
|
|
- graphicalStaffEntry.PositionAndShape,
|
|
|
- EngravingRules.Rules.ChordSymbolTextHeight,
|
|
|
- transposeHalftones);
|
|
|
- const graphicalLabel: GraphicalLabel = graphicalChordSymbolContainer.GetGraphicalLabel;
|
|
|
- graphicalLabel.PositionAndShape.RelativePosition.y -= EngravingRules.Rules.ChordSymbolYOffset;
|
|
|
- graphicalLabel.setLabelPositionAndShapeBorders();
|
|
|
- graphicalChordSymbolContainer.PositionAndShape.calculateBoundingBox();
|
|
|
- graphicalStaffEntry.graphicalChordContainer = graphicalChordSymbolContainer;
|
|
|
+ public createChordSymbols(sourceStaffEntry: SourceStaffEntry, graphicalStaffEntry: GraphicalStaffEntry, transposeHalftones: number): void {
|
|
|
+ let xShift: number = 0;
|
|
|
+ const chordSymbolSpacing: number = 1; // TODO add engravingrules variable, check for available space until next staffEntry
|
|
|
+ for (const chordSymbolContainer of sourceStaffEntry.ChordContainers) {
|
|
|
+ const graphicalChordSymbolContainer: GraphicalChordSymbolContainer =
|
|
|
+ new GraphicalChordSymbolContainer(chordSymbolContainer,
|
|
|
+ graphicalStaffEntry.PositionAndShape,
|
|
|
+ EngravingRules.Rules.ChordSymbolTextHeight,
|
|
|
+ transposeHalftones);
|
|
|
+ const graphicalLabel: GraphicalLabel = graphicalChordSymbolContainer.GetGraphicalLabel;
|
|
|
+ graphicalLabel.PositionAndShape.RelativePosition.y -= EngravingRules.Rules.ChordSymbolYOffset;
|
|
|
+ graphicalLabel.PositionAndShape.RelativePosition.x += xShift;
|
|
|
+ graphicalLabel.setLabelPositionAndShapeBorders();
|
|
|
+ graphicalChordSymbolContainer.PositionAndShape.calculateBoundingBox();
|
|
|
+ graphicalStaffEntry.graphicalChordContainers.push(graphicalChordSymbolContainer);
|
|
|
+
|
|
|
+ xShift += graphicalLabel.PositionAndShape.Size.width + chordSymbolSpacing;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|