MacTech Network:   MacForge.net  |  Computer Memory  |  Register Domains  |  Printer Supplies  |  Cables  |  iPod Deals  |  Mac Deals  |  Mac Book Shelf


  MacTech Magazine

The journal of Macintosh technology

 
 
FAXstf

Magazine In Print
  About MacTech  
  Home Page  
  Subscribe  
  Archives DVD  
  Submit News  
  Submit a Tip!  
  Get a copy of MacTech RISK FREE  
Google
Entire Web
mactech.com
Mac Community
More...
MacTech Central
  by Category  
  by Company  
  by Product  
MacTech News
  MacTech News  
  Previous News  
  MacTech RSS  
Article Archives
  Show Indices  
  by Volume  
  by Author  
  Source Code FTP  
Inside MacTech
  Writer's Kit  
  Editorial Staff  
  Editorial Calendar  
  Back Issues  
  Advertising  
Contact Us
  Customer Service  
  MacTech Store  
  Legal/Disclaimers  
  Webmaster Feedback  
ADVERTISEMENT
Click Here
Volume Number:8
Issue Number:1
Column Tag:Code Correction

Diamond WDEF Source Code Correction

There was a minor error in the “Diamond WDEF” source code that was printed in the October, 1991 issue. Sometimes the zoom region is drawn incorrectly after a zoom. The code failed to properly ensure that the window’s zoom rectangle’s height and width begin their lives as even numbers (to avoid round off error when calculating mid-points). Here is the corrected code (SetUpStdZoom routine):

/* 1 */

/* Make sure x and yDistance are even */
xDistance = (theRect.right - theRect.left) & MAKE_EVEN;
theRect.right = theRect.left + xDistance;
yDistance = (theRect.bottom - theRect.top) & MAKE_EVEN;
theRect.bottom = theRect.top + yDistance;

The difference being that xDistance and yDistance are applied to theRect regardless of whether or not they are equal in size.

According to the author, Marisano J. James, there is a more serious error that appears after zooming under System 7, but at this time, he is not certain what causes this problem. After much experimentation he feels that System 7 assumes that the portRect should be smaller than the structure regions bounding box.

[As information becomes available, we’ll print it here. - Ed.]



Click here to find out more about our best subscription bundle deal ever!
2 years of the magazine, and the all new MacTech DVD ... at 70% off!



Click on the cover to
see this month's issue!

TRIAL SUBSCRIPTION
Get a RISK-FREE subscription to the only technical Mac magazine!
 
 


MacTech Magazine. www.mactech.com
Toll Free 877-MACTECH, Outside US/Canada: 805-494-9797

Register Low Cost (ok dirt cheap!) Domain Names in the MacTech Domain Store. As low as $1.99!
Save on brand compatible and name brank ink jet and laser supplies.
Save on long distance * Upgrade your Computer
Movies with No Late Fees!

See local info about Westlake Village
SJ * BRJ * BJ * OJ * NITS
Staff Site Links



All contents are Copyright 1984-2007 by Xplain Corporation. All rights reserved.

MacTech is a registered trademark of Xplain Corporation. Xplain, Video Depot, Movie Depot, Palm OS Depot, Explain It, MacDev, MacDev-1, THINK Reference, NetProfessional, NetProLive, JavaTech, WebTech, BeTech, LinuxTech, Apple Expo, MacTech Central and the MacTutorMan are trademarks or service marks of Xplain Corporation. Sprocket is a registered trademark of eSprocket Corporation. Other trademarks and copyrights appearing in this printing or software remain the property of their respective holders.