void LayoutBreak::layout0() { qreal _spatium = spatium(); path = QPainterPath(); path2 = QPainterPath(); qreal h = _spatium * 2.5; qreal w = _spatium * 2.5; QRectF rect(0.0, 0.0, w, h); path.addRect(rect); switch(layoutBreakType()) { case Type::LINE: path2.moveTo(w * .8, h * .3); path2.lineTo(w * .8, h * .6); path2.lineTo(w * .3, h * .6); path2.moveTo(w * .4, h * .5); path2.lineTo(w * .25, h * .6); path2.lineTo(w * .4, h * .7); path2.lineTo(w * .4, h * .5); break; case Type::PAGE: path2.moveTo(w*.25, h*.2); path2.lineTo(w*.60, h*.2); path2.lineTo(w*.75, h*.35); path2.lineTo(w*.75, h*.8); path2.lineTo(w*.25, h*.8); path2.lineTo(w*.25, h*.2); path2.moveTo(w*.55, h*.21); // 0.01 to avoid overlap path2.lineTo(w*.55, h*.40); path2.lineTo(w*.74, h*.40); break; case Type::SECTION: path2.moveTo(w*.25, h*.2); path2.lineTo(w*.75, h*.2); path2.lineTo(w*.75, h*.8); path2.lineTo(w*.25, h*.8); path2.moveTo(w*.55, h*.21); // 0.01 to avoid overlap path2.lineTo(w*.55, h*.79); break; default: qDebug("unknown layout break symbol"); break; } QRectF bb(0, 0, w, h); bb.adjust(-lw, -lw, lw, lw); setbbox(bb); }
bool LayoutBreak::acceptDrop(const DropData& data) const { return data.element->type() == Element::Type::LAYOUT_BREAK && static_cast<LayoutBreak*>(data.element)->layoutBreakType() != layoutBreakType(); }
bool LayoutBreak::acceptDrop(MuseScoreView*, const QPointF&, Element* e) const { return e->type() == LAYOUT_BREAK && static_cast<LayoutBreak*>(e)->layoutBreakType() != layoutBreakType(); }
bool LayoutBreak::acceptDrop(EditData& data) const { return data.dropElement->type() == ElementType::LAYOUT_BREAK && toLayoutBreak(data.dropElement)->layoutBreakType() != layoutBreakType(); }