226 !ActiveHelpView methodsFor:'private'! |
226 !ActiveHelpView methodsFor:'private'! |
227 |
227 |
228 computeShape |
228 computeShape |
229 "compute the shape, based upon the size of my component view" |
229 "compute the shape, based upon the size of my component view" |
230 |
230 |
231 |extent shapeForm borderForm y1 bw h w mirrorH mirrorV |
231 |extent oldOrigin shapeForm borderForm y1 bw h w mirrorH mirrorV |
232 p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition| |
232 p1 p2 p3 pB1 pB2 pB3 offs hEll h2 w2 w8 w78 mousePosition| |
233 |
233 |
234 device supportsArbitraryShapedViews ifTrue:[ |
234 device supportsArbitraryShapedViews ifTrue:[ |
235 (shapeStyle == #cartoon) ifTrue:[ |
235 (shapeStyle == #cartoon) ifTrue:[ |
236 extent := self extent. |
236 extent := self extent. |
|
237 oldOrigin := self origin. |
237 h := extent y. |
238 h := extent y. |
238 w := extent x. |
239 w := extent x. |
239 bw := 4. |
240 bw := 4. |
240 offs := 0. |
241 offs := 0. |
241 mousePosition := device pointerPosition. |
242 mousePosition := device pointerPosition. |
242 |
243 |
243 ((mousePosition > (device width * (2/3))) |
244 ((mousePosition > (device width * (2/3))) |
244 or:[ self corner x > device usableWidth ]) ifTrue:[ |
245 or:[ self corner x > device usableWidth ]) ifTrue:[ |
245 mirrorH := true. |
246 mirrorH := true. |
246 self origin:((self origin x - w) @ (self origin y)). |
247 self origin:((oldOrigin x - w) @ (self origin y)). |
247 offs := bw * 2. |
248 offs := bw * 2. |
248 ] ifFalse:[ |
249 ] ifFalse:[ |
249 mirrorH := false |
250 mirrorH := false |
250 ]. |
251 ]. |
251 ((mousePosition > (device height * (2/3))) |
252 ((mousePosition > (device height * (2/3))) |
252 or:[ self corner y > device usableHeight ]) ifTrue:[ |
253 or:[ self corner y > device usableHeight ]) ifTrue:[ |
253 mirrorV := true. |
254 mirrorV := true. |
254 self origin:(self origin x @ (self origin y - h)). |
255 self origin:(oldOrigin x @ (self origin y - h)). |
255 ] ifFalse:[ |
256 ] ifFalse:[ |
256 mirrorV := false |
257 mirrorV := false |
257 ]. |
258 ]. |
258 |
259 |
259 borderForm := Form width:w height:h. |
260 borderForm := Form width:w height:h. |
321 shapeForm paint:(Color noColor). |
322 shapeForm paint:(Color noColor). |
322 shapeForm displayPolygon:(Array with:p3 with:p1 with:p2). |
323 shapeForm displayPolygon:(Array with:p3 with:p1 with:p2). |
323 |
324 |
324 shapeForm paint:(Color colorId:1). |
325 shapeForm paint:(Color colorId:1). |
325 shapeForm fillArcX:bw y:y1 + bw |
326 shapeForm fillArcX:bw y:y1 + bw |
326 width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2)) |
327 width:(w - (bw * 2)) height:(h // 3 * 2 - (bw * 2)) |
327 from:0 angle:360. |
328 from:0 angle:360. |
328 ]. |
329 ]. |
329 borderForm notNil ifTrue:[ |
330 borderForm notNil ifTrue:[ |
330 self borderShape:borderForm. |
331 self borderShape:borderForm. |
331 self viewShape:shapeForm |
332 self viewShape:shapeForm |
332 ]. |
333 ]. |