From: andrey mirtchovski <aam396@mail.usask.ca>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Re: moving things in a window
Date: Tue, 26 Sep 2000 11:15:16 -0600 [thread overview]
Message-ID: <Pine.LNX.4.10.10009261109230.13135-100000@neon.myriadgate.net> (raw)
In-Reply-To: <E13dy5X-0002Zc-00@chiark.greenend.org.uk>
I asked Russ Cox for an explanation of the code, and I promptly received
one:
(with hopes it's useful and he doesn't mind me sending private email)
--- begin paste ---
/* clean up previous location */
if (osize && clear) {
draw(imgmask, imgmask->r, display->black, nil, ZP); // transparent
fillellipse(imgmask, subpt(oldp, p1), osize, osize, display->white, ZP); // draw opaque old
fillellipse(imgmask, ZP, size, size, display->black, ZP); // cover new
draw(screen, rectaddpt(imgmask->r, p1), display->white, imgmask, imgmask->r.min);
}
We start with a black square.
Then we draw a white circle where the old circle was.
Then we draw a black circle where the new circle will be.
The result is a black image with a sliver of white corresponding to
the area of the old circle that is outside the new circle.
Interpreted as a mask, black is transparent; white opaque.
So the mask says ``only draw where the old circle was
but the new circle is not''.
The final draw puts white down in those places.
--- end paste --
the explanation may be a bit too high level for you though :)
On Tue, 26 Sep 2000, Theo Honohan wrote:
[snip]
next prev parent reply other threads:[~2000-09-26 17:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-26 17:00 Theo Honohan
2000-09-26 17:15 ` andrey mirtchovski [this message]
2000-09-26 18:00 ` Theo Honohan
2000-09-28 10:18 ` Douglas A. Gwyn
2000-09-28 11:28 ` Theo Honohan
2000-09-29 8:31 ` Douglas A. Gwyn
2000-09-27 0:08 okamoto
2000-09-27 0:19 ` Theo Honohan
2000-09-27 0:17 okamoto
2000-09-27 0:30 okamoto
2000-09-27 0:35 rob pike
2000-09-27 6:27 okamoto
2000-09-29 12:35 Russ Cox
2000-10-02 9:00 ` Douglas A. Gwyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.10.10009261109230.13135-100000@neon.myriadgate.net \
--to=aam396@mail.usask.ca \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).