[squeak-dev] The Trunk: Morphic-laza.184.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] The Trunk: Morphic-laza.184.mcz

commits-2
Alexander Lazarević uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-laza.184.mcz

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

Name: Morphic-laza.184
Author: laza
Time: 9 September 2009, 2:21:25 am
UUID: 2f779f3d-9aaa-3942-89a1-278cd4a76254
Ancestors: Morphic-laza.183

Add a check for range >= 1

=============== Diff against Morphic-laza.183 ===============

Item was changed:
  ----- Method: SystemProgressMorph>>label:min:max: (in category 'private') -----
  label: shortDescription min: minValue max: maxValue
  | slot range newBarSize barSize lastRefresh |
  ((range := maxValue - minValue) < 0 or: [(slot := self nextSlotFor: shortDescription) = 0])
  ifTrue: [^[:barVal| 0 ]].
  range <= 0 ifTrue: [self removeMorph: (bars at: slot)].
  self recenter.
  self openInWorld.
  barSize := -1. "Enforces a inital draw of the morph"
  lastRefresh := 0.
  ^[:barVal |
  barVal isString ifTrue: [
  self setLabel: barVal at: slot.
  self currentWorld displayWorld].
+ (barVal isNumber and: [range >= 1 and: [barVal between: minValue and: maxValue]]) ifTrue: [
- (barVal isNumber and: [barVal between: minValue and: maxValue]) ifTrue: [
  newBarSize := (barVal - minValue / range * BarWidth) truncated.
  newBarSize = barSize ifFalse: [
  barSize := newBarSize.
  (bars at: slot) barSize: barSize.
  Time primMillisecondClock - lastRefresh > 25 ifTrue: [
  self currentWorld displayWorld.
  lastRefresh := Time primMillisecondClock]]].
  slot]
  !