160 computeShape |
160 computeShape |
161 "computes 2 forms, one for the border, the other for the inside area. The border |
161 "computes 2 forms, one for the border, the other for the inside area. The border |
162 form is borderwidth*2 pixels larger. Each form gets filled with an ellipse of |
162 form is borderwidth*2 pixels larger. Each form gets filled with an ellipse of |
163 1-pixels, to define the shapes (take a look at the XShape spec, for more info) |
163 1-pixels, to define the shapes (take a look at the XShape spec, for more info) |
164 " |
164 " |
165 |border shape extent form| |
|
166 |
|
167 extent := self extent. |
|
168 border := Form extent:extent. |
|
169 shape := Form extent:extent. |
|
170 |
|
171 isElliptical ifTrue:[ |
165 isElliptical ifTrue:[ |
172 border fillArcX:0 y:0 |
166 self makeRoundViewShapeWithBorder:lineWidth. |
173 width:(border width) |
|
174 height:(border height) |
|
175 from:0 |
|
176 angle:360. |
|
177 ] ifFalse:[ |
167 ] ifFalse:[ |
178 border fillRectangleX:0 y:0 |
168 self borderShape:nil. |
179 width:(border width) |
169 self viewShape:nil. |
180 height:(border height) |
|
181 ]. |
170 ]. |
182 |
171 ^ self. |
183 isOpaque ifFalse:[ |
172 |
184 form := border. |
173 "/ |border shape extent form| |
185 border foreground:(Color colorId:0). |
174 "/ |
186 ] ifTrue:[ |
175 "/ extent := self extent. |
187 form := shape. |
176 "/ border := Form extent:extent. |
188 shape foreground:(Color colorId:1). |
177 "/ shape := Form extent:extent. |
189 ]. |
178 "/ |
190 |
179 "/ isElliptical ifTrue:[ |
191 isElliptical ifTrue:[ |
180 "/ border fillArcX:0 y:0 |
192 form fillArcX:lineWidth y:lineWidth |
181 "/ width:(border width) |
193 width:(border width) - (lineWidth * 2) |
182 "/ height:(border height) |
194 height:(border height) - (lineWidth * 2) |
183 "/ from:0 |
195 from:0 |
184 "/ angle:360. |
196 angle:360. |
185 "/ ] ifFalse:[ |
197 ] ifFalse:[ |
186 "/ border fillRectangleX:0 y:0 |
198 form fillRectangleX:lineWidth y:lineWidth |
187 "/ width:(border width) |
199 width:(border width) - (lineWidth * 2) |
188 "/ height:(border height) |
200 height:(border height) - (lineWidth * 2). |
189 "/ ]. |
201 ]. |
190 "/ |
202 self borderShape:border. |
191 "/ isOpaque ifFalse:[ |
203 self viewShape:shape. |
192 "/ form := border. |
204 |
193 "/ border foreground:(Color colorId:0). |
|
194 "/ ] ifTrue:[ |
|
195 "/ form := shape. |
|
196 "/ shape foreground:(Color colorId:1). |
|
197 "/ ]. |
|
198 "/ |
|
199 "/ isElliptical ifTrue:[ |
|
200 "/ form fillArcX:lineWidth y:lineWidth |
|
201 "/ width:(border width) - (lineWidth * 2) |
|
202 "/ height:(border height) - (lineWidth * 2) |
|
203 "/ from:0 |
|
204 "/ angle:360. |
|
205 "/ ] ifFalse:[ |
|
206 "/ form fillRectangleX:lineWidth y:lineWidth |
|
207 "/ width:(border width) - (lineWidth * 2) |
|
208 "/ height:(border height) - (lineWidth * 2). |
|
209 "/ ]. |
|
210 "/ self borderShape:border. |
|
211 "/ self viewShape:shape. |
|
212 |
|
213 "Modified: / 5.6.1999 / 21:28:54 / cg" |
205 ! ! |
214 ! ! |
206 |
215 |
207 !VisualRegion class methodsFor:'documentation'! |
216 !VisualRegion class methodsFor:'documentation'! |
208 |
217 |
209 version |
218 version |
210 ^ '$Header: /cvs/stx/stx/libview2/VisualRegion.st,v 1.2 1998-06-06 17:52:47 cg Exp $' |
219 ^ '$Header: /cvs/stx/stx/libview2/VisualRegion.st,v 1.3 1999-06-05 19:43:56 cg Exp $' |
211 ! ! |
220 ! ! |