Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Offset and the clipping stack. How to use?
Re: Offset and the clipping stack. How to use? [message #10004 is a reply to message #10003] Wed, 13 June 2007 13:09 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mrjt wrote on Wed, 13 June 2007 06:32

Okay, I see how I can use GetClloffCount to record the stack depth and then trim it to the same level when I'm done, but I'm not sure why all this stack manipulation should be necessary for something so simple.


The main reason is to deliberately enforce that any painting (e.g. Paint) returns the offset and clipping to the state it started with.

You know, e.g., all widgets in a U++ window are painted using the single same Draw (there is just single WM_PAINT/Expose for all widgets). If any Paint routine would move offset out and not restored it, the painting result would be a mess...

Surely, there is an alternative solution that would use helper classes to represent "offseted" or "clipped" Draw, hard to say what is really better. In any case, stack in Draw is good enough to do the task.

[Updated on: Wed, 13 June 2007 13:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: AGG again
Next Topic: BSD problems with Draw
Goto Forum:
  


Current Time: Thu Mar 28 18:22:05 CET 2024

Total time taken to generate the page: 0.00892 seconds