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++ Library : Other (not classified elsewhere) » RectTracker & MaxRect
Re: RectTracker & MaxRect [message #18031 is a reply to message #18016] Sun, 07 September 2008 11:42 Go to previous message
Dochy is currently offline  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.
 
Read Message
Read Message
Read Message
Previous Topic: exit() -> heap leaks detected.
Next Topic: My mistake... Sorry
Goto Forum:
  


Current Time: Mon Aug 25 20:05:13 CEST 2025

Total time taken to generate the page: 0.07331 seconds