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 » Problem in dasher.cpp and proposed solution
Problem in dasher.cpp and proposed solution [message #35981] Fri, 13 April 2012 16:02 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

In dasher.cpp if the line drawn is very long, it enters in an almost endless loop.

void Dasher::Line(const Pointf& p)
{
	if(sum == 0) {
		PutLine(p);
		return;
	}
	Pointf v = p - p0;
	double len = Length(v);
	double pos = 0;
	while(pos + rem < len) {
		pos += rem;
		Put(pos / len * v + p0);
		flag = !flag;
		rem = (*pattern)[patterni];
		patterni = (patterni + 1) % pattern->GetCount();
	}
	rem -= len - pos;
	Put(p);
	p0 = p;
}


If "len" is very high, the program gets stuck in the while loop.

If you could limit this in any way, by limiting or len or the number of iterations of the while loop, the problem gets solved.

Thank you Smile.


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Previous Topic: Bug: Missing width in DrawArc on X11
Next Topic: how to dispaly moving text has any idea?
Goto Forum:
  


Current Time: Fri Mar 29 12:15:11 CET 2024

Total time taken to generate the page: 0.01478 seconds