🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6748

Re: Flopping line in MacPaint (rubberband line)

#6748
From: William C. Anderson
Date: Sun, 17 Aug 1986 20:26
32 lines
2443 bytes
In article <2694@mit-hermes.ARPA>, jpexg@mit-hermes.ARPA (John Purbrick) writes:
> Here's the lone dissenter--name removed as it was private mail:
> 
>  Actually, MacPaint keeps the old screen buffer and copies it back each
>  time you move the line to restore the original image.  It doesn't do
>  XOR--if you notice, the line always looks like it will when you finish
>  moving it.  Bill Atkinson has a special routine that copies his "save"
>  bitmap VERY quickly to the screen for just this kind of application,
>  thus the fixed window size.
> 
> So what does everyone else think of this? To me, it has the ring of truth
> about it.
> 						--jp

This is a possibility, but I think that there are more efficient ways to
rubberband an OR line.  One strategy that could be used is to do "reverse
Bresenham": instead of *drawing* a line according to a Bresenham DDA algorithm,
go out to the screen and *copy* the data that is in the area to be drawn
over into some buffer, using the same positioning logic (DDA) that is used in
Bresenham line drawing.  Then draw the line.  When you move the line, just
replace the stuff you copied from the screen and recycle the procedure.
A bit more complex than the XOR technique of drawing the line twice, but
it does the trick with a minimum of copying and buffer space (which was
certainly at a premium in the 128K Mac).

I have seen this technique used in some Multibus graphics buffer boards.
It's not too difficult and would require considerably less data moving
and buffer space than copying the entire screen.  Since Atkinson did lots
of custom code for MacPaint, it is not inconceivable that he used this
technique.  But we'll never *really* know, will we?

William Anderson - University of Texas Computation Center
Technical Details
Message-ID: <3809@ut-ngp.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!wca
References: <2693@mit-hermes.ARPA> <1232@trwrb.UUCP> <208@bridge2.UUCP> <2694@mit-hermes.ARPA>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!wca
From: wca@ut-ngp.UUCP (William C. Anderson)
Newsgroups: net.micro.mac,net.micro.atari16
Subject: Re: Flopping line in MacPaint (rubberband line)
Message-ID: <3809@ut-ngp.UUCP>
Date: Sun, 17-Aug-86 16:26:27 EDT
Article-I.D.: ut-ngp.3809
Posted: Sun Aug 17 16:26:27 1986
Date-Received: Tue, 19-Aug-86 02:00:53 EDT
References: <2693@mit-hermes.ARPA> <1232@trwrb.UUCP> <208@bridge2.UUCP> <2694@mit-hermes.ARPA>
Distribution: net
Organization: UTexas Computation Center, Austin, Texas
Lines: 32
Summary: reverse Bresenham scan convert