Discrete event/agent based simulation

Karl Ramberg karl.ramberg at chello.se
Thu Oct 2 18:14:25 UTC 2003



Ned Konz wrote:

> It's now possible (with mode 34, as Andreas pointed out to me) to:
> - use the AA support in the Balloon engine to do antialiased drawing
> into a private Form
> - render a Form into a previously cleared (as in: all 0's) Bitmap
> - blit it onto the Display canvas and do a proper blend.
> 
> Unfortunately, the border highlighting is hard to get right for more
> complex borders (think circles).
> Balloon doesn't support complex border styles.
> 
> I believe that Andreas is using a generalized version of form
> composition for things like window corners in Tweak.
> 
> I skipped adding support for filled polygons; it seemed to me that lines
> and filled polygons were enough different that they deserved to be
> different classes (if you look at PolygonMorph you'll see what I mean).
> However, Balloon does a good job on these as long as you don't have a
> complex border style.
I once hacked a simple thing for filled polygons without borders. 

PolygonMorph>>drawOn: aCanvas 
        "Display the receiver, a spline curve, approximated by straight 
        line segments."
        | array aSecond |
        vertices size < 1
                ifTrue: [self error: 'a polygon must have at least one point'].
        closed ifTrue:
                [aSecond _ aCanvas asBalloonCanvas.
                        aSecond aaLevel: 4. aSecond drawPolygon: self
getVertices fillStyle:
self fillStyle.
                aSecond isShadowDrawing ifTrue: [^ self]].
        array _ self drawArrowsOn: aSecond.
        self drawClippedBorderOn: aSecond usingEnds: array.

This change is not optimal. I think anti-alias should be set through a 
menu option, so also the aa level.
But now that you have aa for borders maybe I'll add this and we can
finaly enjoy 
aa polygons :-)

Karl



More information about the Squeak-dev mailing list