[squeak-dev] The Trunk: MorphicExtras-ct.326.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 25 10:27:39 UTC 2022


Christoph Thiede uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ct.326.mcz

==================== Summary ====================

Name: MorphicExtras-ct.326
Author: ct
Time: 25 August 2022, 12:27:22.96198 pm
UUID: 822538c1-96ba-424a-a003-00bd197fadb0
Ancestors: MorphicExtras-eem.322

Fixes error flood in Piano Roll for invalid MIDI key when dragging a note out of the vertical bounds.

=============== Diff against MorphicExtras-eem.322 ===============

Item was changed:
  ----- Method: PianoRollScoreMorph>>drawStaffOn: (in category 'drawing') -----
  drawStaffOn: aCanvas
  
  	| blackKeyColor l r topEdge y |
  	self drawMeasureLinesOn: aCanvas.
  
  	blackKeyColor := Color gray: 0.5.
  	l := self left + self borderWidth.
  	r := self right - self borderWidth.
  	topEdge := self top + self borderWidth + 3.
+ 	lowestNote to: self highestNote do: [:k |
- 	lowestNote to: 127 do: [:k |
  		y := self yForMidiKey: k.
  		y <= topEdge ifTrue: [^ self].  "over the top!!"
  		(self isBlackKey: k) ifTrue: [
  			aCanvas
  				fillRectangle: (l at y corner: r@(y + 1))
  				color: blackKeyColor]].
  !

Item was added:
+ ----- Method: PianoRollScoreMorph>>highestNote (in category 'private') -----
+ highestNote
+ 
+ 	^ 127!

Item was changed:
  ----- Method: PianoRollScoreMorph>>midiKeyForY: (in category 'geometry') -----
  midiKeyForY: y
  
+ 	^ (lowestNote - ((y - (bounds bottom - self borderWidth - 4)) // 3))
+ 		clampLow: 0 high: self highestNote!
- 	^ lowestNote - ((y - (bounds bottom - self borderWidth - 4)) // 3)
- !



More information about the Squeak-dev mailing list