[squeak-dev] The Trunk: Morphic-ar.190.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-ar.190.mcz

commits-2
Andreas Raab uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ar.190.mcz

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

Name: Morphic-ar.190
Author: ar
Time: 23 September 2009, 7:49:23 am
UUID: 18965e3f-8d35-ac45-b94a-eefa107dba28
Ancestors: Morphic-dtl.189, Morphic-rkrk.189

Merging Morphic-rkrk.189:

Fix for FormCanvas>>frameAndFillRoundRect:radius:fillStyle:borderWidth:borderColor:. when rect or radius is degenerated. This bug appeared e..g when resizing the switch button pane in the Browser to a very small width.

=============== Diff against Morphic-dtl.189 ===============

Item was changed:
  ----- Method: FormCanvas>>frameAndFillRoundRect:radius:fillStyle:borderWidth:borderColor: (in category 'drawing-rectangles') -----
  frameAndFillRoundRect: aRectangle radius: cornerRadius fillStyle: fillStyle borderWidth: bw borderColor: bc
  "Draw a rounded rectangle"
  self shadowColor ifNotNil:[
  ^self fillRoundRect: aRectangle radius: cornerRadius fillStyle: shadowColor.
  ].
  "see if the round rect is degenerate"
  cornerRadius asPoint <= (0@0)
+ ifTrue:[^self frameAndFillRectangle: aRectangle fillColor: fillStyle asColor borderWidth: bw borderColor: bc].
- ifTrue:[^self frameAndFillRectangle: aRectangle fillColor: fillStyle borderWidth: bw borderColor: bc].
  cornerRadius * 2 >= aRectangle width
+ ifTrue:[^self fillOval: aRectangle color: fillStyle asColor borderWidth: bw borderColor: bc].
- ifTrue:[^self fillOval: aRectangle color: fillStyle borderWidth: bw borderColor: bc].
  "Okay it's a rounded rectangle"
  fillStyle isTransparent ifFalse:["fill interior"
  | innerRect radius |
  innerRect := aRectangle.
  radius := cornerRadius.
  bw isZero ifFalse:[
  innerRect := innerRect insetBy: bw.
  radius := radius - bw.
  ].
  self fillRoundRect: innerRect radius: radius fillStyle: fillStyle.
  ].
  self frameRoundRect: aRectangle radius: cornerRadius width: bw color: bc
  !