[squeak-dev] The Trunk: MorphicExtras-bf.241.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jul 6 19:51:06 UTC 2018


Bert Freudenberg uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-bf.241.mcz

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

Name: MorphicExtras-bf.241
Author: bf
Time: 6 July 2018, 12:50:51.907705 pm
UUID: 9fa635ce-e870-48d6-bc03-7fe4a95af05a
Ancestors: MorphicExtras-ul.240

FrameRateMorph: ensure at least one pixel is drawn per frame to not get bogus numbers

=============== Diff against MorphicExtras-ul.240 ===============

Item was changed:
  ----- Method: FrameRateMorph>>step (in category 'stepping and presenter') -----
  step
  	"Compute and display (every half second or so) the current framerate"
  
  	| now mSecs mSecsPerFrame framesPerSec newContents |
  	framesSinceLastDisplay := framesSinceLastDisplay + 1.
  	now := Time millisecondClockValue.
  	mSecs := now - lastDisplayTime.
  	(mSecs > 500 or: [mSecs < 0 "clock wrap-around"]) ifTrue: 
  		[mSecsPerFrame := mSecs // framesSinceLastDisplay.
  		framesPerSec := (framesSinceLastDisplay * 1000) // mSecs.
  		newContents := mSecsPerFrame printString, ' mSecs (', framesPerSec printString, ' frame', (framesPerSec = 1 ifTrue: [''] ifFalse: ['s']), '/sec)'.
  		self contents: newContents.
  		lastDisplayTime := now.
+ 		framesSinceLastDisplay := 0]
+ 	ifFalse:
+ 		["Ensure at least one pixel is drawn per frame"
+ 		Preferences higherPerformance ifTrue: [self invalidRect: (self position extent: 1 at 1)]]!
- 		framesSinceLastDisplay := 0]!



More information about the Squeak-dev mailing list