Home » U++ Library support » U++ Library : Other (not classified elsewhere) » RectTracker & MaxRect
Re: RectTracker & MaxRect [message #18031 is a reply to message #18016] |
Sun, 07 September 2008 11:42  |
Dochy
Messages: 2 Registered: September 2008 Location: Czech rep.
|
Junior Member |
|
|
Quote: | Try using a different align. ALIGN_NULL means you have full freedom to drag in any direction.
|
I know. But it is what I want. Anywhere in view area begin and anywhere end. Problem is only, that I want restricted position of end to border of view, but now there is restriction to right and bottom only. I solved it by simply modification of RectTracker::MouseMove
if(tx == ALIGN_NULL) {
rect.right = min(org.right - op.x + p.x, maxrect.right);
if (rect.right < rect.left) {
Swap(rect.right, rect.left);
rect.InflateHorz(1);
}
}
to:
if(tx == ALIGN_NULL) {
pom.x = min(org.right - op.x + p.x, maxrect.right);
rect.right = max(pom.x, maxrect.left);
if (rect.right < rect.left) {
Swap(rect.right, rect.left);
}
}
But it is not clear enaugh. There are variations of +-1 pixel depending of draw direction.
Now it's adequate for me, but not as final solution.
Thanks for interest.
|
|
|
Goto Forum:
Current Time: Mon Aug 25 12:50:22 CEST 2025
Total time taken to generate the page: 0.06205 seconds
|