Fix #32966 - TAB: hide fingerings

Simple and cheap fix which simply hides `Fingering` elements in TAB's. No change to the linking / copying stuff: elements are still there, but generate no visible output in TAB. See issue http://musescore.org/en/node/32966 for details and discussion.

Should an option for hiding / showing these elements be added in the future, as discussed in the forum issue, the change would be trivial.

This does not affect lute-specific RH fingerings recently added, as luckily they are not real `Fingering`s, but `Articulation`s.
This commit is contained in:
Maurizio M. Gavioli 2015-02-18 19:06:29 +01:00
parent 399ea1daab
commit 507aa6cd01
2 changed files with 26 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include "fingering.h"
#include "score.h"
#include "staff.h"
#include "undo.h"
#include "xml.h"
@ -53,6 +54,29 @@ void Fingering::read(XmlReader& e)
}
}
//---------------------------------------------------------
// layout
//---------------------------------------------------------
void Fingering::layout()
{
if (staff() && staff()->isTabStaff()) // in TAB staves
setbbox(QRectF()); // fingerings have no area
else
Text::layout();
}
//---------------------------------------------------------
// draw
//---------------------------------------------------------
void Fingering::draw(QPainter* painter) const
{
if (staff() && staff()->isTabStaff()) // hide fingering in TAB staves
return;
Text::draw(painter);
}
//---------------------------------------------------------
// reset
//---------------------------------------------------------

View file

@ -33,6 +33,8 @@ class Fingering : public Text {
Note* note() const { return (Note*)parent(); }
virtual void draw(QPainter*) const override;
virtual void layout() override;
virtual void write(Xml&) const override;
virtual void read(XmlReader&) override;
virtual void reset() override;