[squeak-dev] The Trunk: Graphics-ul.155.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Nov 16 04:35:09 UTC 2010


Levente Uzonyi uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-ul.155.mcz

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

Name: Graphics-ul.155
Author: ul
Time: 16 November 2010, 4:51:23.593 am
UUID: fa62ac4b-96d3-b348-919d-a1ea814fdc8d
Ancestors: Graphics-ul.154

- use #= for integer comparison instead of #== (http://bugs.squeak.org/view.php?id=2788 )

=============== Diff against Graphics-ul.154 ===============

Item was changed:
  ----- Method: AbstractFont>>approxWidthOfText: (in category 'measuring') -----
  approxWidthOfText: aText
  "Return the width of aText -- quickly, and a little bit dirty. Used by lists morphs containing Text objects to get a quick, fairly accurate measure of the width of a list item."
  
      | w |
      
+     (aText isNil or: [aText size = 0 ])
-     (aText isNil or: [aText size == 0 ])
          ifTrue:[^0].
         
      w := self
          widthOfString: aText asString.
  
       "If the text has no emphasis, just return the string size.  If it is empasized, 
      just approximate the width by adding about 20% to the width"   
+     (((aText runLengthFor: 1) = aText size)
+         and: [(aText emphasisAt: 1) = 0 ])
-     (((aText runLengthFor: 1) == aText size)
-         and: [(aText emphasisAt: 1) == 0 ])
              ifTrue:[^w]
              ifFalse:[ ^w * 6 // 5 ]. !

Item was changed:
  ----- Method: Color class>>fromArray: (in category 'instance creation') -----
  fromArray: colorDef
+ 	colorDef size = 3
- 	colorDef size == 3
  			ifTrue: [^self r: (colorDef at: 1) g: (colorDef at: 2) b: (colorDef at: 3)].
+ 	colorDef size = 0
- 	colorDef size == 0
  			ifTrue: [^Color transparent].
+ 	colorDef size = 4
- 	colorDef size == 4
  			ifTrue: [^(TranslucentColor r: (colorDef at: 1) g: (colorDef at: 2) b: (colorDef at: 3)) alpha: (colorDef at: 4)].
  	self error: 'Undefined color definition'!

Item was changed:
  ----- Method: Quadrangle>>displayOn: (in category 'displaying-generic') -----
  displayOn: aDisplayMedium
  	"Display the border and insideRegion of the receiver."
  
+ 	borderWidth ~= 0 ifTrue: [
+ 		aDisplayMedium
+ 			border: self region
+ 			widthRectangle: borderWidth
+ 			rule: Form over
+ 			fillColor: borderColor ].
+ 	insideColor ifNotNil: [
+ 		aDisplayMedium fill: self inside fillColor: insideColor ]!
- 	borderWidth ~~ 0
- 		ifTrue:	[aDisplayMedium
- 				border: self region
- 				widthRectangle: borderWidth
- 				rule: Form over
- 				fillColor: borderColor].
- 	insideColor ~~ nil
- 		ifTrue:	[aDisplayMedium fill: self inside fillColor: insideColor]!

Item was changed:
  ----- Method: Quadrangle>>displayOn:transformation:clippingBox: (in category 'displaying-generic') -----
  displayOn: aDisplayMedium transformation: aWindowingTransformation clippingBox: aRectangle
  	"Display the border and region of the receiver so that it is scaled and 
  	translated with respect to aWindowingTransformation. The displayed 
  	information should be clipped so that only information with the area 
  	determined by aRectangle is displayed."
  
  	| screenRectangle |
  	screenRectangle := 
  		(aWindowingTransformation applyTo: self) intersect: aRectangle.
+ 	(borderWidth ~= 0 and: [ insideColor notNil ])
- 	borderWidth ~~ 0 & (insideColor ~~ nil)
  		ifTrue: 
  			[aDisplayMedium fill: screenRectangle fillColor: Color black "borderColor".
  			aDisplayMedium
  				fill: (screenRectangle insetBy: borderWidth)
  				fillColor: insideColor]!




More information about the Squeak-dev mailing list