Apple II Technical Notes _____________________________________________________________________________ Developer Technical Support Apple IIgs #72: QuickDraw II Quirks Revised by: Dave Lyons May 1992 Written by: Dave Lyons & C. K. Haun November 1989 This Technical Note points out some things things you need to watch out for when using QuickDraw II, especially with FastPort-aware and Shadowing modes. CHANGES SINCE NOVEMBER 1990: Removed some obsolete information on ScrollRect and on shadowing. Noted that DrawPicture in 6.0 is now compatible with FastPort mode. Added a warning about making QuickDraw II calls while QuickDraw II is not started. _____________________________________________________________________________ DON'T CALL QUICKDRAW II WHILE IT'S INACTIVE Most QuickDraw II functions behave unpredictably if you call them while QuickDraw II is inactive, so watch it! Don't make QuickDraw II calls while QuickDraw II isn't started, except as documented. GrafOn and GrafOff are okay. (And so are QDStartUp, QDVersion, and QDStatus.) FASTPORT-AWARE ANOMALY Before System 6.0, when the FastPort-aware bit is turned on in the MasterSCB parameter to QDStartUp, DrawPicture did not notice changes in the pen pattern. If your application does not require 6.0 and uses pictures, either directly or indirectly (i.e., by printing to the ImageWriter driver), you may need to leave FastPort-aware mode turned off to get the expected behavior. FASTFONT AND LARGE PIXEL MAPS FastFont does not work correctly when drawing past the first 64K of a pixel map. If you are drawing text that uses FastFont (i.e., Shaston 8), you can avoid this problem by using a non-rectangular clipRgn. DON'T SHOWPEN WHILE COLLECTING POLYGONS, REGIONS, OR PICTURES The Macintosh QuickDraw documentation permits calling ShowPen after an OpenPoly, OpenRgn, or OpenPicture call to cause drawing calls to contribute to a polygon, region, or picture AND draw to a pixel map at the same time. The Apple IIgs QuickDraw II documentation does not say you can do that. In some cases, it works, but it works "by accident" and it's not one of the things Apple tests or guarantees in QuickDraw II. YOU MAY NEED SETBUFDIMS! The call description for SetBufDims on page 16-215 of Volume 2 of theToolbox Reference is misleading. The note in the description states, "You only need to make this call if your application is going to use, or allow the user to choose, fonts that have unusually large values of chExtra and spExtra." This is not true; you need to call SetBufDims to adjust the clipping buffers for your application if you plan to use a clipRgn that has a greater width than the width you passed at QDStartUp. SetBufDims sets the clipping buffer width as well as that of the text buffer, so if you plan to use a clipping region larger than the startup port width you must use SetBufDims. Be aware that this call may be necessary even if your application does not ever set a clipping region or rectangle. Some toolbox calls assume that the clipping buffer size is correct based on the parameters passed to that routine. For example, if the locInfo you pass to CopyPixels has a width parameter that is wider than the width you passed at QDStartUp, CopyPixels may fail. A safe rule of thumb is to make sure (possibly by setting) that the width parameter in the buffer dimensions is the same or greater than the widest width in the locInfo structures passed to routines that use them. Further Reference _____________________________________________________________________________ o Apple IIgs Toolbox Reference, Volumes 1 and 3