Skip to content

Commit

Permalink
fix #195146: After adding a rehearsalmark by double clicking the pale…
Browse files Browse the repository at this point in the history
…tte-element is cloned and restyled. The restyled clone is always horizontal centered. Because of the bitwise OR in the restyle-method it can get centered AND right aligned! That is why I suggest unsetting all HMASK-flags before setting new horizontal-alignment-flags. The same should be right for the VMASK-flags. This fixes the problem descibed here: https://musescore.org/en/node/195036#comment-706826
  • Loading branch information
lyrischesich committed Jan 4, 2018
1 parent 1432f87 commit 47bd7bc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libmscore/elementlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,14 @@ bool ElementLayout::readProperties(XmlReader& e)

void ElementLayout::restyle(const ElementLayout& ol, const ElementLayout& nl)
{
if ((ol._align & AlignmentFlags::HMASK) == (_align & AlignmentFlags::HMASK))
if ((ol._align & AlignmentFlags::HMASK) == (_align & AlignmentFlags::HMASK)) {
_align &= AlignmentFlags::VMASK; // unset all HMASK-flags before setting new flags
_align |= nl._align & AlignmentFlags::HMASK;
if ((ol._align & AlignmentFlags::VMASK) == (_align & AlignmentFlags::VMASK))
}
if ((ol._align & AlignmentFlags::VMASK) == (_align & AlignmentFlags::VMASK)) {
_align &= AlignmentFlags::HMASK; // unset all VMASK-Flags before setting new flags
_align |= nl._align & AlignmentFlags::VMASK;
}
if (ol._offset == _offset)
_offset = nl._offset;
if (_offsetType == ol._offsetType)
Expand Down

0 comments on commit 47bd7bc

Please sign in to comment.