Browse Source

Better note positions for whole notes

master
Nils 5 years ago
parent
commit
26984688ef
  1. 2
      engine/api.py
  2. 7
      engine/track.py
  3. 13
      qtgui/items.py
  4. 10742
      qtgui/resources.py
  5. 23
      qtgui/resources/svg/noteheadsWhole.svg

2
engine/api.py

@ -909,10 +909,12 @@ def selectRight():
callbacks._setCursor(destroySelection = False)
def measureLeft():
"""Goes a few steps left when not in metrical context"""
session.data.currentTrack().measureLeft()
callbacks._setCursor()
def measureRight():
"""Goes a few right left when not in metrical context"""
session.data.currentTrack().measureRight()
callbacks._setCursor()

7
engine/track.py

@ -570,6 +570,10 @@ class Track(object):
"""We don't use goToTickIndex for this because that
is a slow function that starts from head()"""
goalInTicks = self.state.tickindex - self.state.metricalInstruction().oneMeasureInTicks
if self.state.metricalInstruction().oneMeasureInTicks == 0:
goalInTicks -= D1
while self.left():
if self.state.tickindex <= goalInTicks:
@ -583,6 +587,9 @@ class Track(object):
else:
goalInTicks = self.state.tickindex + self.state.metricalInstruction().oneMeasureInTicks
if self.state.metricalInstruction().oneMeasureInTicks == 0:
goalInTicks += D1
while self.right():
if self.state.tickindex >= goalInTicks:
break

13
qtgui/items.py

@ -56,17 +56,7 @@ class GuiTieCurveGraphicsItem(QtWidgets.QGraphicsPathItem):
empty (0,0)."""
super().__init__()
self.setPen(GuiTieCurveGraphicsItem.pen)
if noteExportObject["dotOnLine"] < 0: #higher than the middle line
#self.translate(6, -5)
pass
else:
if noteExportObject["notehead"] <= 1: #whole notes have a bug in the gui because the backend stem info is misleading. Works fine except for ties.
pass #TODO
#self.translate(6, 0)
else:
pass #TODO
#self.translate(6, 6)
self.setTransform(QtGui.QTransform.fromTranslate(0, -6), True)
self.noteExportObject = noteExportObject
self.draw()
@ -444,7 +434,6 @@ class GuiChord(GuiItem):
-8 : lambda: QtSvg.QGraphicsSvgItem(":svg/flag8i.svg"),
}
def createGenericFromData(self):
"""Graphics for both rectangles and noteheads"""

10742
qtgui/resources.py

File diff suppressed because it is too large

23
qtgui/resources/svg/noteheadsWhole.svg

@ -13,7 +13,7 @@
width="1000"
height="1000"
id="svg3460"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="noteheadsWhole.svg">
<sodipodi:namedview
pagecolor="#ffffff"
@ -24,16 +24,16 @@
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1916"
inkscape:window-height="1041"
inkscape:window-width="2300"
inkscape:window-height="1046"
id="namedview6"
showgrid="false"
inkscape:zoom="5.3400704"
inkscape:cx="3.053232"
inkscape:cy="945.45537"
inkscape:window-x="1920"
inkscape:window-y="18"
inkscape:window-maximized="0"
inkscape:zoom="60.416"
inkscape:cx="4.3972899"
inkscape:cy="1001.3557"
inkscape:window-x="1536"
inkscape:window-y="1080"
inkscape:window-maximized="1"
inkscape:current-layer="svg3460" />
<metadata
id="metadata3468">
@ -50,7 +50,8 @@
<defs
id="defs3466" />
<path
d="m 3.0346811,-2.85 c -1.0444213,0 -1.4830783,1.05 -1.4830783,2.2 0,1.975 1.2533056,3.5 2.9034914,3.5 1.0444214,0 1.46219,-1.05 1.46219,-2.2 0,-1.975 -1.2324173,-3.5 -2.8826031,-3.5 z M 8.9669949,0 c 0,1.075 -0.7102069,1.875 -1.5248556,2.4 -1.1279751,0.725 -2.4230576,1 -3.6972516,1 C 2.4706936,3.4 1.1547227,3.125 0.0267476,2.4 -0.78790111,1.875 -1.4981076,1.075 -1.4981076,0 c 0,-1.075 0.71020649,-1.875 1.5248552,-2.4 1.1279751,-0.725 2.443946,-1 3.7181401,-1 1.274194,0 2.5692765,0.275 3.6972516,1 0.8146487,0.525 1.5248556,1.325 1.5248556,2.4 z"
d="m 4.1294803,-2.85 c -0.9502635,0 -1.3493743,1.05 -1.3493743,2.2 0,1.975 1.140316,3.5 2.6417331,3.5 0.9502644,0 1.3303694,-1.05 1.3303694,-2.2 0,-1.975 -1.1213111,-3.5 -2.6227282,-3.5 z M 9.5269793,0 c 0,1.075 -0.6461797,1.875 -1.3873858,2.4 -1.0262849,0.725 -2.2046116,1 -3.3639334,1 C 3.6163383,3.4 2.4190059,3.125 1.392721,2.4 0.65151479,1.875 0.00533505,1.075 0.00533505,0 c 0,-1.075 0.64617974,-1.875 1.38738595,-2.4 1.0262849,-0.725 2.2236173,-1 3.3829391,-1 1.1593218,0 2.3376485,0.275 3.3639334,1 0.7412061,0.525 1.3873858,1.325 1.3873858,2.4 z"
id="path3462"
inkscape:connector-curvature="0" />
inkscape:connector-curvature="0"
style="stroke-width:0.95385909" />
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save