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 |
omari
Messages: 266 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&,
instead of
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.
|
|
|
Goto Forum:
Current Time: Wed Jun 05 08:20:59 CEST 2024
Total time taken to generate the page: 0.02030 seconds
|