Beispiel #1
0
QPointF BarLine::pagePos() const
      {
      if (parent() == 0)
            return pos();
      System* system;
      if (parent()->type() != Element::Type::SEGMENT)
            system = static_cast<System*>(parent());
      else
            system = static_cast<Segment*>(parent())->measure()->system();

      qreal yp = y();
      if (system) {
            // get first not hidden staff
            int staffIdx1 = staffIdx();
            Staff* staff1 = score()->staff(staffIdx1);
            SysStaff* sysStaff1 = system->staff(staffIdx1);
            while ( staff1 && sysStaff1 && !(sysStaff1->show() && staff1->show()) ) {
                  staffIdx1++;
                  staff1 = score()->staff(staffIdx1);
                  sysStaff1 = system->staff(staffIdx1);
                  }
            yp += system->staffYpage(staffIdx1);
            }
      return QPointF(pageX(), yp);
      }
Beispiel #2
0
QPointF Breath::pagePos() const
      {
      if (parent() == 0)
            return pos();
      System* system = segment()->measure()->system();
      qreal yp = y();
      if (system)
            yp += system->staff(staffIdx())->y() + system->y();
      return QPointF(pageX(), yp);
      }
Beispiel #3
0
QPointF BarLine::pagePos() const
      {
      if (parent() == 0)
            return pos();
      System* system = measure()->system();
      qreal yp = y();
      if (system)
            yp += system->staffY(staffIdx());
      return QPointF(pageX(), yp);
      }
Beispiel #4
0
QPointF BSymbol::pagePos() const
      {
      if (parent() && (parent()->type() == ElementType::SEGMENT)) {
            QPointF p(pos());
            System* system = segment()->measure()->system();
            if (system) {
                  p.ry() += system->staff(staffIdx())->y() + system->y();
                  }
            p.rx() = pageX();
            return p;
            }
      else
            return Element::pagePos();
      }
Beispiel #5
0
QPointF FretDiagram::pagePos() const
      {
      if (parent() == 0)
            return pos();
      if (parent()->type() == ElementType::SEGMENT) {
            Measure* m = static_cast<Segment*>(parent())->measure();
            System* system = m->system();
            qreal yp = y();
            if (system)
                  yp += system->staffYpage(staffIdx());
            return QPointF(pageX(), yp);
            }
      else
            return Element::pagePos();
      }
Beispiel #6
0
QPointF BarLine::pagePos() const
      {
      if (parent() == 0)
            return pos();
      System* system;
      if (parent()->type() != SEGMENT)
            system = static_cast<System*>(parent());
      else
            system = static_cast<Segment*>(parent())->measure()->system();

      qreal yp = y();
      if (system)
            yp += system->staffY(staffIdx());
      return QPointF(pageX(), yp);
      }
Beispiel #7
0
QPointF FretDiagram::pagePos() const
      {
      if (parent() == 0)
            return pos();
      if (parent()->isSegment()) {
            Measure* m = toSegment(parent())->measure();
            System* system = m->system();
            qreal yp = y();
            if (system)
                  yp += system->staffYpage(staffIdx());
            return QPointF(pageX(), yp);
            }
      else
            return Element::pagePos();
      }
Beispiel #8
0
QPointF Articulation::pagePos() const
      {
      if (parent() == 0 || parent()->parent() == 0)
            return pos();
      if (parent()->isChordRest()) {
            ChordRest* cr = static_cast<ChordRest*>(parent());
            Measure* m = cr->measure();
            if (m == 0)
                  return pos();
            System* system = m->system();
            if (system == 0)
                  return pos();
            qreal yp = y() + system->staff(staffIdx() + cr->staffMove())->y() + system->y();
            return QPointF(pageX(), yp);
            }
      return Element::pagePos();
      }
Beispiel #9
0
void MouseRelatedEvent::computePageLocation()
{
    float zoomFactor = pageZoomFactor(this);
    setAbsoluteLocation(roundedLayoutPoint(FloatPoint(pageX() * zoomFactor, pageY() * zoomFactor)));
}
Beispiel #10
0
void MouseRelatedEvent::computePageLocation()
{
    float scaleFactor = pageZoomFactor(this) * frameScaleFactor(this);
    setAbsoluteLocation(LayoutPoint(pageX() * scaleFactor, pageY() * scaleFactor));
}
void MouseRelatedEvent::computePageLocation()
{
    setAbsoluteLocation(LayoutPoint(pageX(), pageY()));
}
Beispiel #12
0
QPointF LedgerLine::pagePos() const
      {
      System* system = chord()->measure()->system();
      qreal yp = y() + system->staff(staffIdx())->y() + system->y();
      return QPointF(pageX(), yp);
      }