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?
Offset and the clipping stack. How to use? [message #9983] Tue, 12 June 2007 15:47 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I'd like to be able to use the following function (from Draw::):
Quote:

void Offset(int x, int y)
Creates a new coordinate / clipping entry on top of the stack equal to the previous entry with coordinate origin shifted by (x, y) pixels.


But if this always adds a new entry to the stack, and the stack must end at with the same length as it started, how do you do cumulative offsets?

for example, the code below works because we know how many offsets were pushed:
draw.Offset(5, 20);
draw.Offset(5, 20);
draw.Offset(5, 20);
draw.End();
draw.End();
draw.End();

But this is not possible if the number of stack pushes is uncertain. Is there a way to either: automatically clear the stack, or add to an offset without pushing on a new stack op?

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


Current Time: Fri Apr 19 02:05:42 CEST 2024

Total time taken to generate the page: 0.03484 seconds