Skip to content

Commit

Permalink
adapt bsp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Jan 3, 2014
1 parent 8fa9e9a commit b1e03fd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
12 changes: 5 additions & 7 deletions libmscore/bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class FindItemBspTreeVisitor : public BspTreeVisitor
for (int i = 0; i < items->size(); ++i) {
Element* item = items->at(i);
if (!item->itemDiscovered) {
item->itemDiscovered = 1;
item->itemDiscovered = true;
foundItems.prepend(item);
}
}
Expand Down Expand Up @@ -138,9 +138,8 @@ QList<Element*> BspTree::items(const QRectF& rect)
{
FindItemBspTreeVisitor findVisitor;
climbTree(&findVisitor, rect);
for (Element * e : findVisitor.foundItems) {
e->itemDiscovered = 0;
}
for (Element * e : findVisitor.foundItems)
e->itemDiscovered = false;
return findVisitor.foundItems;
}

Expand All @@ -154,9 +153,8 @@ QList<Element*> BspTree::items(const QPointF& pos)
climbTree(&findVisitor, pos);

QList<Element*> l;
for (int i = 0; i < findVisitor.foundItems.size(); ++i) {
Element* e = findVisitor.foundItems.at(i);
e->itemDiscovered = 0;
for (Element* e : findVisitor.foundItems) {
e->itemDiscovered = false;
if (e->contains(pos))
l.append(e);
}
Expand Down
4 changes: 2 additions & 2 deletions libmscore/element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Element::Element(Score* s) :
_mag(1.0),
_tag(1),
_score(s),
itemDiscovered(0)
itemDiscovered(false)
{
}

Expand All @@ -326,7 +326,7 @@ Element::Element(const Element& e)
_score = e._score;
_bbox = e._bbox;
_tag = e._tag;
itemDiscovered = 0;
itemDiscovered = false;
}

//---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion libmscore/element.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class Element : public QObject {
*/
virtual bool mousePress(const QPointF&, QMouseEvent*) { return false; }

mutable int itemDiscovered; ///< helper flag for bsp
mutable bool itemDiscovered; ///< helper flag for bsp

virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true);

Expand Down
1 change: 0 additions & 1 deletion libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3091,7 +3091,6 @@ void Score::lassoSelect(const QRectF& bbox)
QList<Element*> el = page->items(frr);
for (int i = 0; i < el.size(); ++i) {
Element* e = el.at(i);
e->itemDiscovered = 0;
if (frr.contains(e->abbox())) {
if (e->type() != Element::MEASURE && e->selectable())
select(e, SELECT_ADD, 0);
Expand Down
1 change: 0 additions & 1 deletion libmscore/scorefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,6 @@ void Score::print(QPainter* painter, int pageNo)
QList<Element*> ell = page->items(fr);
qStableSort(ell.begin(), ell.end(), elementLessThan);
foreach(const Element* e, ell) {
e->itemDiscovered = 0;
if (!e->visible())
continue;
painter->save();
Expand Down

0 comments on commit b1e03fd

Please sign in to comment.