From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: moving things in a window Date: Wed, 27 Sep 2000 09:17:01 +0900 From: okamoto@granite.cias.osakafu-u.ac.jp MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-ybjzvylzhtmzxvcrmhmwreuspb" Message-Id: <20000927001625.F0ADD199ED@mail> Topicbox-Message-UUID: 0fa4aaca-eac9-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-ybjzvylzhtmzxvcrmhmwreuspb Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit So, I wrote my comment to note this technique is not so generally applicable to want ot avoid Russ doesn't stop his effort to implement translucent layer. :-) kenji --upas-ybjzvylzhtmzxvcrmhmwreuspb Content-Type: message/rfc822 Content-Disposition: inline Received: from granite.cias.osakafu-u.ac.jp ([192.168.1.3]) by diabase; Wed Sep 27 02:16:05 JST 2000 Received: from elmo.cias.osakafu-u.ac.jp (elmo.cias.osakafu-u.ac.jp [157.16.103.2]) by granite.cias.osakafu-u.ac.jp (8.9.3/8.9.3) with ESMTP id CAA11349; Wed, 27 Sep 2000 02:16:51 +0900 Received: from mail (postfix@psuvax1.cse.psu.edu [130.203.4.6]) by elmo.cias.osakafu-u.ac.jp (8.9.3/3.7W-00080718) with ESMTP id CAA12324; Wed, 27 Sep 2000 02:16:29 +0900 (JST) Received: from psuvax1.cse.psu.edu (unknown [130.203.20.6]) by mail (CSE Mail Server) with ESMTP id 805F119A16; Tue, 26 Sep 2000 13:16:08 -0400 (EDT) Received: from neon.myriadgate.net (openbsd.myriadgate.net [139.142.42.2]) by mail (CSE Mail Server) with ESMTP id 75CF019A01 for <9fans@cse.psu.edu>; Tue, 26 Sep 2000 13:15:33 -0400 (EDT) Received: from localhost (aam396@localhost) by neon.myriadgate.net (8.9.3/8.9.3) with ESMTP id LAA16217 for <9fans@cse.psu.edu>; Tue, 26 Sep 2000 11:15:16 -0600 X-Authentication-Warning: neon.myriadgate.net: aam396 owned process doing -bs Date: Tue, 26 Sep 2000 11:15:16 -0600 (CST) From: andrey mirtchovski X-Sender: aam396@neon.myriadgate.net To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: moving things in a window In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the O/S Plan 9 from Bell Labs <9fans.cse.psu.edu> 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] --upas-ybjzvylzhtmzxvcrmhmwreuspb--