use of com.xenoage.zong.layout.frames.ScoreFrameChain in project Zong by Xenoage.
the class Layout method computeLP.
/**
* Returns the {@link LayoutPos} of the given {@link MP} within the given {@link Score}
* at the given line position, or null if unknown.
*/
public LayoutPos computeLP(Score score, MP mp, float lp) {
ScoreFrameChain chain = getScoreFrameChain(score);
if (chain != null) {
ScoreLayout sl = chain.getScoreLayout();
ScoreLayoutPos slp = sl.getScoreLP(mp, lp);
if (slp != null) {
ScoreFrame frame = chain.getFrames().get(slp.frameIndex);
Page page = frame.getParentPage();
if (page != null) {
Point2f frameP = slp.pMm.sub(frame.getSize().width / 2, frame.getSize().height / 2);
int pageIndex = pages.indexOf(page);
Point2f pMm = frame.getPagePosition(frameP);
return layoutPos(this, pageIndex, pMm);
}
}
}
return null;
}
Aggregations