fix StaffLines bounding box
This commit is contained in:
parent
07bda70230
commit
838451c1b6
4 changed files with 7 additions and 6 deletions
|
@ -203,6 +203,7 @@ void Segment::init()
|
|||
_shapes.assign(staves, Shape());
|
||||
_prev = 0;
|
||||
_next = 0;
|
||||
_stretch = 0.0; // debug
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
|
|
@ -77,9 +77,9 @@ QPointF StaffLines::canvasPos() const
|
|||
|
||||
void StaffLines::layout()
|
||||
{
|
||||
Staff* s = staff();
|
||||
Staff* s = staff();
|
||||
qreal _spatium = spatium();
|
||||
qreal dist = _spatium;
|
||||
qreal dist = _spatium;
|
||||
setPos(QPointF(0.0, 0.0));
|
||||
int _lines;
|
||||
if (s) {
|
||||
|
@ -101,7 +101,7 @@ void StaffLines::layout()
|
|||
qreal x1 = pos().x();
|
||||
qreal x2 = x1 + w;
|
||||
qreal y = pos().y();
|
||||
bbox().setRect(x1, -lw*.5 + y, w, (_lines-1) * _spatium + lw);
|
||||
bbox().setRect(x1, -lw * .5 + y, w, (_lines-1) * dist + lw);
|
||||
|
||||
lines.clear();
|
||||
for (int i = 0; i < _lines; ++i) {
|
||||
|
|
|
@ -2501,7 +2501,7 @@ void Timeline::mouseOver(QPointF pos)
|
|||
{
|
||||
//Choose item with the largest original Z value...
|
||||
QList<QGraphicsItem*> graphics_list = scene()->items(pos);
|
||||
QGraphicsItem* hovered_graphics_item;
|
||||
QGraphicsItem* hovered_graphics_item = 0;
|
||||
int max_z_value = -1;
|
||||
for (QGraphicsItem* curr_graphics_item: graphics_list) {
|
||||
if (dynamic_cast<QGraphicsTextItem*>(curr_graphics_item))
|
||||
|
|
|
@ -157,8 +157,8 @@ class Timeline : public QGraphicsView {
|
|||
void setMetaData(QGraphicsItem* gi, int staff, ElementType et, Measure* m, bool full_measure, Element* e, QGraphicsItem* pair_item = nullptr, Segment* seg = nullptr);
|
||||
unsigned int getMetaRow(QString target_text);
|
||||
|
||||
int global_measure_number;
|
||||
int global_z_value = 0;
|
||||
int global_measure_number { 0 };
|
||||
int global_z_value { 0 };
|
||||
|
||||
//True if meta value was last clicked
|
||||
bool meta_value = false;
|
||||
|
|
Loading…
Reference in a new issue