[Newbie]PaintBoxMorph enhancement question

Karl Ramberg karl.ramberg at chello.se
Sun Apr 23 18:49:09 UTC 2000



Bob Arning wrote:

> On Sat, 22 Apr 2000 20:28:08 +0200 Karl Ramberg <karl.ramberg at chello.se> wrote:
> >I've been playing with the PaintBoxMorph trying to enhance on the
> >drawing cursor and found a paintbrush cursor that was used but
> >not visible (?)(Try the changeset). Also I wanted to make the brush like
> >the precision
> >brush in Photoshop a one pixel ring the size of the brush, xor(reverse?)
> >to the background.
> >Now I got a paintbrush, a white square with a one pixel border the size
> >of the brush,
> >transparency does not work and the bigger the extent of the brush the
> >more white space I get.
> >Anybody care to shed some light on this for me ?
>
> Karl,
>
> I can tell you how to fix it without being completely sure why. If after:
>
>                 ff _ currentCursor copy: larger.
>
> you also say:
>
>                 ff colors at: 1 put: Color transparent.
>                 ff colors at: 2 put: Color transparent.
>
> then you will get the effect I think you are looking for. The first two entries in the ColorForm's color map have special significance (background and foreground, I think). They were, respectively, white and black (or the very dark blue that stands for black) in the form you were working with and it appears that somewhere ther was a conflicting assumption that Transparent meant the first slot.
>
> Cheers,
> Bob

Thanks, that's the solution. And like you said it's hard to explain why you need
this extra code here when the latter #erase action workes without any of that with the
exakt same code.

Now I just have to figure out the rest. Make the square outline a circle and the
outline reversed to the background.

thanks again

Karl






More information about the Squeak-dev mailing list