示例#1
0
文件: page.cpp 项目: DDMAL/verovio
void Page::JustifyHorizontally()
{
    Doc *doc = dynamic_cast<Doc *>(GetParent());
    assert(doc);

    if (!doc->GetJustificationX()) {
        return;
    }

    // Doc::SetDrawingPage should have been called before
    // Make sure we have the correct page
    assert(this == doc->GetDrawingPage());

    // Justify X position
    Functor justifyX(&Object::JustifyX);
    JustifyXParams justifyXParams(&justifyX);
    justifyXParams.m_systemFullWidth = doc->m_drawingPageWidth - doc->m_drawingPageLeftMar - doc->m_drawingPageRightMar;
    this->Process(&justifyX, &justifyXParams);
}