Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!ntvaxb!ie15 From: ie15@vaxb.acs.unt.edu Newsgroups: comp.os.os2.programmer Subject: Re: Drawing & Clipping Message-ID: <33586.26dfdb60@vaxb.acs.unt.edu> Date: 1 Sep 90 16:01:36 GMT References: <1385@metaphor.Metaphor.COM> Lines: 47 In article <1385@metaphor.Metaphor.COM>, rimola@solrac.metaphor.com (Carlos Rimola) writes: > A basic (I hope) PM question: > > I have an analog clock application that experiences a clipping peculiarity > when it is partly overlayed by a dialog or a pull down menu. eg: > > +-------+ > |\ | (1) > (2) +======+ | > +======+ | > | \ | > +-------+ > > (1) is the main window, (2) is a dialog that is partly overlaying the > window, the "\" symbols represent a line that is partly overlayed by > the dialog. The problem is that often the drawing that takes place outside > of the overlayed area (outside not under it) is incorrect. eg: > > 1) draw a line > 2) overlay window with a dialog, partly covering the line > 3) erase the line by redrawing it using the background color > 4) remove the dialog > > At the end of this operation I end up with the line partly erased, the > portion under the dialog is correct but that portion not covered by the > dialog is not. eg: > > +-------+ > |\ | > | | > | | > | \ | > +-------+ > > Can someone explain why this is happening and what can be done to fix it? It depends on how you're getting your PS. If it's during the WM_PAINT you get after the dialog is moved it is working as designed, probably, since PM will give you a PS that has a clipping boundry defined by the invalidated rectange of your window. Therefore your got the PS from WinBeginPaint() and drew the line. It even worked. But since the clipping rectangle is only the size of the dialog box that was over your window the bottom and the bottom segments of the line were not drawn. Does anybody agree with me? Ken Tabor UNT