use of com.xenoage.zong.musiclayout.stampings.FlagsStamping in project Zong by Xenoage.
the class FlagsRenderer method draw.
/**
* Draws the given {@link FlagsStamping} on the given {@link Canvas},
* using the given {@link RendererArgs}.
*/
@Override
public void draw(Stamping stamping, Canvas canvas, RendererArgs args) {
FlagsStamping s = (FlagsStamping) stamping;
Symbol symbol = args.symbolPool.getSymbol(CommonSymbol.NoteFlag);
boolean flagsMirrored = (s.flagsDirection == FlagsDirection.Up);
float flagsDistance = FlagsStamping.getFlagsDistance(s.flagsDirection, s.scaling);
// draw all flags
for (int i : range(s.flagsCount)) {
StaffSymbolRenderer.drawWith(symbol, null, sp(s.position.xMm, // TODO: flag position is not correct yet
s.position.lp + flagsDistance * 0.2f + /* move a little bit into the stem */
i * 2 * flagsDistance), s.scaling, s.parentStaff, flagsMirrored, canvas, args);
}
}
Aggregations