Browse Source

Drawing fixes

master
Nils 2 years ago
parent
commit
847b612626
  1. 4
      CHANGELOG
  2. 3
      engine/items.py
  3. 14
      qtgui/items.py

4
CHANGELOG

@ -15,6 +15,7 @@ Rewrite grid, which was a performance drag in the past.
Add functions to move block to start or end of track.
Scroll view when dragging blocks and tracks with the mouse.
Block name font color is now always readable, no matter the background color
Shift+Up and Down will now select the current chord.
Add 3/2 to metrical instruction.
Add custom Multimeasure-Rest submenu and menu command.
Add multiplication buttons to the tick widget.
@ -31,7 +32,8 @@ Metronome audio outputs now use real metronome name, not only pretty name
Use lilypond title as jack pretty client name, if provided (needs libcalfbox-lss 1.1.0)
Add preview image to Lilypond properties and metadata
More information about the cursor and position in the status bar
Fix drawing of ties and staccato dots.
Fix ledger lines of added chord notes
## 2022-04-15 2.0.3
Use the new systewide library libcalfbox-lss instead of providing our own. This lib is now a dependency.

3
engine/items.py

@ -1040,6 +1040,7 @@ class Chord(Item):
if pitchmath.toWhite[pitch] in self.whitePitchlist():
return False #only one of each base note in a chord. no cis, ces and c in the same chord.
else:
self._cachedClefForLedgerLines = None #this resets the actual ledger cache, otherwise added notes get no ledger lines.
oldNotelist = self.notelist.copy() #only copies the order, not the items itself. Which is what we need.
self.notelist.append(note)
self.notelist.sort()
@ -2448,7 +2449,7 @@ class MetricalInstruction(Item):
def __init__(self, treeOfInstructions, isMetrical = True):
"""Don't edit. Delete and create a new one
A few examples, but this has a real explanation in the manual
A few examples, but this has a complete explanation in the manual
5/4 as 3+2 ((D4, D4, D4), (D4, D4))
5/4 broken as 3 + 2 unstressed notes ((D4, D4, D4), D4, D4)

14
qtgui/items.py

@ -293,10 +293,14 @@ class GuiNote(QtWidgets.QGraphicsItem):
if noteExportObject["durationKeyword"]:
self.durationKeywordGlyph = GuiNote.durationKeywords[noteExportObject["durationKeyword"]](noteExportObject)
if directionRightAndUpwards:
self.durationKeywordGlyph.setPos(3, 6)
#width = self.noteHead.boundingRect().width() #1000 !? Weird svg.
#setPos is relative to noteHead.
if directionRightAndUpwards and noteExportObject["durationKeyword"]==api.D_STACCATO:
#self.durationKeywordGlyph.setScale(-1) #doesn't work because center of rotation is somehwere at pixel 1000!!
self.durationKeywordGlyph.setPos(4, -1*constantsAndConfigs.stafflineGap) #x should be the width of the notehead.
else:
self.durationKeywordGlyph.setPos(3, -6)
self.durationKeywordGlyph.setPos(4, constantsAndConfigs.stafflineGap-1)
self.durationKeywordGlyph.setParentItem(self.noteHead)
@ -313,7 +317,7 @@ class GuiNote(QtWidgets.QGraphicsItem):
durationKeywords = { #0 is default and has no markers.
api.D_STACCATO : lambda noteExportObject: QtSvg.QGraphicsSvgItem(":svg/scriptsStaccato.svg"),
api.D_TENUTO : lambda noteExportObject: QtWidgets.QGraphicsSimpleTextItem("-"), #TODO: tenuto glyph
api.D_TENUTO : lambda noteExportObject: QtWidgets.QGraphicsSimpleTextItem("-"), #TODO: tenuto svg glyph with same position as the others.
api.D_TIE : lambda noteExportObject: GuiTieCurveGraphicsItem(noteExportObject),
}
@ -406,6 +410,7 @@ class GuiChord(GuiItem):
#Ledger Lines
below, above = self.staticItem["ledgerLines"]
for i in range(below):
line = QtWidgets.QGraphicsLineItem(QtCore.QLineF(0, 0, 12, 0))
line.setPen(GuiChord.ledgerPen)
@ -714,7 +719,6 @@ class GuiMetricalInstruction(GuiItem):
def __init__(self, staticItem):
super().__init__(staticItem)
print (staticItem)
if staticItem["oneMeasureInTicks"] == 0:
#Basically just a manual barline
displayString = "X"

Loading…
Cancel
Save