void Box::editDrag(const EditData& ed) { if (type() == VBOX) { _boxHeight = Spatium((ed.pos.y() - abbox().y()) / spatium()); if (ed.vRaster) { qreal vRaster = 1.0 / MScore::vRaster(); int n = lrint(_boxHeight.val() / vRaster); _boxHeight = Spatium(vRaster * n); } bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); system()->setHeight(height()); score()->doLayoutPages(); } else { _boxWidth += Spatium(ed.delta.x() / spatium()); if (ed.hRaster) { qreal hRaster = 1.0 / MScore::hRaster(); int n = lrint(_boxWidth.val() / hRaster); _boxWidth = Spatium(hRaster * n); } foreach(Element* e, _el) { if (e->type() == TEXT) { static_cast<Text*>(e)->setModified(true); // force relayout } } score()->setLayoutAll(true); } layout(); }
void VBox::layout() { setPos(QPointF()); // !? if (system()) bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); else bbox().setRect(0.0, 0.0, 50, 50); Box::layout(); }
void VBox::layout() { setPos(QPointF()); // !? if (system()) setbbox(QRectF(0.0, 0.0, system()->width(), point(boxHeight()))); else setbbox(QRectF(0.0, 0.0, 50, 50)); Box::layout(); }
void TBox::layout() { setPos(QPointF()); // !? bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); _text->layout(); _text->setPos(leftMargin() * MScore::DPMM, topMargin() * MScore::DPMM); qreal h = _text->isEmpty() ? _text->lineSpacing() : _text->height(); bbox().setRect(0.0, 0.0, system()->width(), h); MeasureBase::layout(); // layout LayoutBreak's }
void TBox::layout() { setPos(QPointF()); // !? bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); foreach(Element* e, _el) { if (e->isText()) { Text* text = static_cast<Text*>(e); text->layout(); qreal h; if (text->isEmpty()) h = text->lineSpacing(); else h = text->height(); text->setPos(leftMargin() * MScore::DPMM, topMargin() * MScore::DPMM); bbox().setRect(0.0, 0.0, system()->width(), h); } } MeasureBase::layout(); // layout LayoutBreak's }
void Box::editDrag(const EditData& ed) { if (type() == Element::Type::VBOX) { _boxHeight = Spatium((ed.pos.y() - abbox().y()) / spatium()); if (ed.vRaster) { qreal vRaster = 1.0 / MScore::vRaster(); int n = lrint(_boxHeight.val() / vRaster); _boxHeight = Spatium(vRaster * n); } bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); system()->setHeight(height()); score()->doLayoutPages(); } else { _boxWidth += Spatium(ed.delta.x() / spatium()); if (ed.hRaster) { qreal hRaster = 1.0 / MScore::hRaster(); int n = lrint(_boxWidth.val() / hRaster); _boxWidth = Spatium(hRaster * n); } score()->setLayoutAll(true); } layout(); }
void FBox::layout() { // setPos(QPointF()); // !? bbox().setRect(0.0, 0.0, system()->width(), point(boxHeight())); Box::layout(); }
QPointF VBox::getGrip(int) const { return QPointF(0.0, boxHeight().val()); }
void FBox::layout() { setPos(QPointF()); // !? setbbox(QRectF(0.0, 0.0, system()->width(), point(boxHeight()))); Box::layout(); }