folklore.org
The Original Macintosh:    20 of 121 
Round Rects Are Everywhere!
Author: Andy Hertzfeld
Date: May 1981
Characters: Steve Jobs, Bill Atkinson
Topics: Software Design, Inspiration, QuickDraw
Summary: Steve inspires Bill by pointing out something about the real world

Bill Atkinson worked mostly at home, but whenever he made significant progress he rushed in to Apple to show it off to anyone who would appreciate it. This time, he visited the Macintosh offices at Texaco Towers to show off his brand new oval routines, which were implemented using a really clever algorithm.



Bill had added new code to QuickDraw (which was still called LisaGraf at this point) to draw circles and ovals very quickly. That was a bit hard to do on the Macintosh, since the math for circles usually involved taking square roots, and the 68000 processor in the Lisa and Macintosh didn't support floating point operations. But Bill had come up with a clever way to do the circle calculation that only used addition and subtraction, not even multiplication or division, which the 68000 could do, but was kind of slow at.

Bill's technique used the fact the sum of a sequence of odd numbers is always the next perfect square (For example, 1 + 3 = 4, 1 + 3 + 5 = 9, 1 + 3 + 5 + 7 = 16, etc). So he could figure out when to bump the dependent coordinate value by iterating in a loop until a threshold was exceeded. This allowed QuickDraw to draw ovals very quickly.

Bill fired up his demo and it quickly filled the Lisa screen with randomly-sized ovals, faster than you thought was possible. But something was bothering Steve Jobs. "Well, circles and ovals are good, but how about drawing rectangles with rounded corners? Can we do that now, too?"

"No, there's no way to do that. In fact it would be really hard to do, and I don't think we really need it". I think Bill was a little miffed that Steve wasn't raving over the fast ovals and still wanted more.

Steve suddenly got more intense. "Rectangles with rounded corners are everywhere! Just look around this room!". And sure enough, there were lots of them, like the whiteboard and some of the desks and tables. Then he pointed out the window. "And look outside, there's even more, practically everywhere you look!". He even persuaded Bill to take a quick walk around the block with him, pointing out every rectangle with rounded corners that he could find.

When Steve and Bill passed a no-parking sign with rounded corners, it did the trick. "OK, I give up", Bill pleaded. "I'll see if it's as hard as I thought." He went back home to work on it.

Bill returned to Texaco Towers the following afternoon, with a big smile on his face. His demo was now drawing rectangles with beautifully rounded corners blisteringly fast, almost at the speed of plain rectangles. When he added the code to LisaGraf, he named the new primitive "RoundRects". Over the next few months, roundrects worked their way into various parts of the user interface, and soon became indispensable.

The Apple Spirit
Back to The Original Macintosh
Scrooge McDuck

Login
Account Name:

Password:

Create new account
Related Stories
Rating
Overall Rating: 4.60
(best)

Your rating:

  1

  2

  3

  4

  5
7 Comments     
At MacHack, when most of the original team was there and Andy told this story, Jef Raskin spoke up to say that he had told Steve about round rectangles being everywhere, and that's what got Steve obsessed about them. But what I found interesting was something Bill Atkinson said about creating the RoundRect routines. He said they turned out to be a lot easier to create than he thought they would be. I can't tell you how many times I've over-estimated something easy. I think it's something inherent in computer work.
What I find interesting about this story is the complete lack of support for RoundRects in Cocoa and its predecessors. I needed them for an old program I was rebuilding for OS X recently and ended up rolling them by hand.
I was at IBM back in those days, and was one of a few evangelizing for support for the kind of applications and user interfaces then showing up on the LISA, Mac, Xerox Star etc. I worked for a division which did applications, and part of my job was trying to drive requirements into the personal systems division. I became infamous as one of the guys who went to Boca Raton and Hursley in England and talked about bit-mapped graphics. Most of the guys at IBM doing graphics those days came from a tradition of mainframe based CAD, and just couldn't understand guys like me, and in particular why we wanted rounded corner rectangles!
Amazing story. I can't even imagine the early user interface without roundrects - all the buttons and desk accessories!
There's a lot to say about people wondering why on earth graphical interfaces would've been neccessary to introduce (the IBM CAD folks here mentioned above). It's the psychology of keeping the status quo and inside-box thinking that still revers today.
The trick with prime numbers and iteration to get to rond lines is magnificent. The day I got introduced to Laplace transformations I immediatelt understood the importants of simplifying complicated functions for graphics computational purposes. But reducing geometric graphic drawing to mere plus and minus operations, well that's the genius! There's a book out on such things like magic with numbers by Alex Bellos "Alex's Adventures in Numberland" at Bloomsbury. It's mentioned there.
.. Ah, so now I finally see the origin of the routine name *Bump*Oval in QuickDraw