Tablature grace note layout issues

• Apr 16, 2021 - 16:55
Reported version
3.6
Type
Functional
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
  1. The TAB COMMON style will display a grace note stem (no slash) above the staff. It should add a slash for ACCIACCATURA.

  2. Switch from TAB COMMON to TAB FULL. Notice the grace note stems move closer to the grace notes (good), however the slash is left up above the staff. Switch back to TAB COMMON and the slashes are visible but above the top of the grace stem.

  3. Turn off the TAB CLEF. Any TAB staff that starts with grace notes will now draw the grace notes in the left margin. Add the TAB CLEF back in and all's good.


Comments

To fix the "slash" problems (1 and 2 above) add 2 lines to chord.cpp at around line 2270 in layoutTablature(). It appears that "_stemSlash" needs to updated every time the "_hook" is updated. I attached a sample file -- look at it before and after adding the 2 new lines. Also switch between TAB-COMMON and TAB-FULL to see the "stray slashes" problem also gets fixed.

Replace this:
_hook->setPos(p);
}
}

With this:
_hook->setPos(p);
}
if (_stemSlash)
_stemSlash->layout();
}

Attachment Size
Test_Grace_Notes.mscz 12.39 KB

You also moved the added lines up into the previous block, intentional?

Before:

                p.rx() -= _stem->width();
                _hook->setPos(p);
            }
            if (_stemSlash) {
                _stemSlash->layout();
            }
        }
    }
    if (!tab->genDurations()

Now:

                QPointF p(_stem->hookPos());
                p.rx() -= _stem->width();
                _hook->setPos(p);
                if (_stemSlash) {
                    _stemSlash->layout();
                }
            }
        }
    }

In reply to by Jojo-Schmitz

Yes, intentional. The code in 3.x and 4.x are a little different at this location and I screwed up porting it from 3 to 4. I created a new PR because I didn't know how to do it the right way. I now know how to make changes to an existing PR so I won't do that anymore.

OK. But no, the code is not different at that place as far as I can tell (I ported it back to 3.x), just the style is (the extra pair of braces and the indenting).