Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!mcnc!rti!bcw From: bcw@rti.rti.org (Bruce Wright) Newsgroups: comp.windows.ms.programmer Subject: Re: MDI devloper Pen Pal Summary: Grids and mapping modes Message-ID: <1991Apr16.033639.11295@rti.rti.org> Date: 16 Apr 91 03:36:39 GMT References: <25920007@hpkslx.mayfield.HP.COM> Organization: Research Triangle Institute, RTP, NC Lines: 42 In article , dsampson@x102a.harris-atd.com (sampson david 58163) writes: > About a year ago I started fooling with trying to create a toolkit of > sorts to handle some common things like a spreadsheet type of > interface (the grid look, not necessarily the full functional > capability). I ran into a problem that drove me nuts when it came to > laying out the grid. > > The thing that drove me nuts was trying to set up a loop to draw the > horizontal lines of the grid so that they would be equi-distant > between the top and bottom of rows of text, i.e. draw a perfectly > semetrical line between two rows of text. > > It was further compounded by the particular mapping mode that was > selected. MM_ANISOTROPIC was a particular pain. When world > coordinates were scales, boy did that throw off the vertical line spacing. > > Everything would look OK on the first few lines, but as you drew more > and more lines (about 100 should do it) the verticle "distortion" grew worse. I'm not sure exactly what your problem is, but there are a couple of possibilities. You might have been seeing aliasing caused by having the mapping mode not match the display resolution. If you are setting the loop up properly the aliasing shouldn't be cumulative (as seems to have been the case with your problem from your description), but some lines would appear to be a pixel or two off. (Although this doesn't seem like a lot, for screens with a lot of horizontal or vertical lines the eye can often zero in on those that are a bit "off", even if the line isn't really very far off). You might also have managed to get some of the aliasing for one line added back into the next (not having seen your code I can't say ...), this could cause a cumulative effect. The usual way to deal with this is to run in MM_TEXT for placement of things like lines, so that you know exactly where things are going to end up. In general you can get better results with the MM_TEXT mode for most graphical operations, but at the cost of making your code more complex. Bruce C. Wright