🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1499

Re: Drawing & Clipping

#1499
From: Carlos Alberto Rimola
Date: Wed, 05 Sep 1990 21:27
57 lines
2910 bytes
In article <33586.26dfdb60@vaxb.acs.unt.edu- ie15@vaxb.acs.unt.edu writes:
-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
-                                                     

I agree with you.  I went ahead and put in a WinGetPS call in addition to
WinBegPaint and proceeded to perform my drawing operations using the PS 
handle returned by WinGetPS and the clipping problem went away.

I am still a bit confused by how clipping works during a WM_PAINT and
why I have not been able to find a discussion of it in the 1.2 PM documents.
I am also unsure that the method that I am using to bypass clipping is
the correct one to use in this situation.
Technical Details
Message-ID: <1406@metaphor.Metaphor.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!apple!metaphor!solrac!rimola
References: <1385@metaphor.Metaphor.COM> <33586.26dfdb60@vaxb.acs.unt.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!apple!metaphor!solrac!rimola
From: rimola@solrac.metaphor.com (Carlos Alberto Rimola)
Newsgroups: comp.os.os2.programmer
Subject: Re: Drawing & Clipping
Message-ID: <1406@metaphor.Metaphor.COM>
Date: 5 Sep 90 21:27:02 GMT
References: <1385@metaphor.Metaphor.COM> <33586.26dfdb60@vaxb.acs.unt.edu>
Sender: news@metaphor.Metaphor.COM
Reply-To: rimola@solrac.metaphor.com (Carlos Alberto Rimola)
Organization: Metaphor Computer Systems, Mountain View, CA
Lines: 57