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 » U++ Core » RectTracker : usage of the callback sync
RectTracker : usage of the callback sync [message #35661] Sun, 11 March 2012 17:16 Go to previous message
omari is currently offline  omari
Messages: 265
Registered: March 2010
Experienced Member
Hello Mirek,

I am using RectTracker and i want to aligne to a grid while tracking a rect.
to do that, i use the callback sync :

to let that work, i do two changes to RectTracker:


1. CtrlCore.h line 1457


I modified the type of parameter of the callback1 from Rect to Rect&,

    Callback1<Rect&> sync; 

instead of
    Callback1<Rect> sync; 



2. LocalLoop.cpp lines 174..180


to let DrawRect() clear the old Rect, i change the order of call to methodes sync() and DrawRect in the MouseMove() methode


	if(rect != o) {
		rect = Round(rect);
		if(rect != o) {
			sync(rect);
			DrawRect(o, rect); // DrawRect after sync, not before.
			o = rect;
		}
	}


instead of

	if(rect != o) {
		rect = Round(rect);
		if(rect != o) {
			DrawRect(o, rect);
			sync(rect);
			o = rect;
		}
	}



the sync callback is it made for this kind of use? or I must use a Rounder instead ?

Thanks


regards
omari.
 
Read Message
Read Message
Read Message
Previous Topic: pimp Stream for protocol generation/processing
Next Topic: Xmlize Null Color
Goto Forum:
  


Current Time: Fri May 03 20:01:49 CEST 2024

Total time taken to generate the page: 0.02927 seconds