Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!topaz!ll-xn!nike!ucbcad!ucbvax!decwrl!harrow@exodus.dec.com From: harrow@exodus.dec.com (Jeff Harrow, NCSE LKG1-3/F16 DTN=226-7445) Newsgroups: net.micro.mac Subject: How to draw a Region around a random Line? Message-ID: <4848@decwrl.DEC.COM> Date: Mon, 18-Aug-86 11:06:11 EDT Article-I.D.: decwrl.4848 Posted: Mon Aug 18 11:06:11 1986 Date-Received: Tue, 19-Aug-86 08:02:59 EDT Sender: daemon@decwrl.DEC.COM Organization: Digital Equipment Corporation Lines: 26 Having received such good advice from my last question about rubber-band lines, I now have another: Given that I have a random line going from StartPt to EndPt (any orientation), what is a good way to create a rectangular Region around it, perhaps 2 pixels out from the line (ie a Region which encloses the line but is slightly larger than the line itself, to make for easier mouse capture). (My problem is not in actually creating the Region, but making it come out in the shape that I want around the line...) My initial simplistic attempt at this (drawing a rectangle around it expanded by the magic "2") works fine for vertical lines, but the region is less and less rectangular, and less and less over the ends of the line (ok in the center) as the line approaches horizontal. (Something tells me that I wish I'd paid more attention to Trig...) Anyway, any ideas on a generalized algorithm? (This doesn't belong here, but boy, is Lightspeed PASCAL **GREAT**!) Jeff