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
Re: Problem in dasher.cpp and proposed solution [message #35982 is a reply to message #35981] Sat, 14 April 2012 11:22 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14258
Registered: November 2005
Ultimate Member
koldo wrote on Fri, 13 April 2012 10:02

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.


If I understand it well, this is the same problem as

http://www.ultimatepp.org/redmine/issues/214

correct?

There is no easy solution to this... Perhaps some rough clip estimate before doing stroke?
 
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: Wed May 14 05:09:50 CEST 2025

Total time taken to generate the page: 0.02924 seconds