MuseScore/libmscore/stafftext.h
Marc Sabatella a780a36dea fix #301259
Resolves: https://musescore.org/en/node/301259

See also https://github.com/musescore/MuseScore/pull/5728/

The problem occurs in several different overrides to
getPropertyStyle() for various different text classes.
The function is supposed to determine
which Sid to use for Pid::OFFSET, based on placement above/below.
But that calculation should only be relevant
if the element is using the default text style for its type.
Otherwise it should use the offset in the current text style.

This code removes the overrides for getPropertyStyle() in each class,
instead modifying TextBase::getPropertyStyle() to check
if the element is using its default text style or not,
and then only if so does it use the placement to select a Sid.
Otherwise it uses the offset of the current text style.
2020-04-15 18:07:27 -06:00

41 lines
1.1 KiB
C++

//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __STAFFTEXT_H__
#define __STAFFTEXT_H__
#include "text.h"
#include "part.h"
#include "staff.h"
#include "stafftextbase.h"
namespace Ms {
//---------------------------------------------------------
// StaffText
//---------------------------------------------------------
class StaffText final : public StaffTextBase {
QVariant propertyDefault(Pid id) const override;
public:
StaffText(Score* s = 0, Tid = Tid::STAFF);
StaffText* clone() const override { return new StaffText(*this); }
ElementType type() const override { return ElementType::STAFF_TEXT; }
void layout() override;
};
} // namespace Ms
#endif