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 » DrawPolygon in Report
BugConfirmed.gif  DrawPolygon in Report [message #6919] Mon, 04 December 2006 14:14 Go to next message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
The Polygon has wrong position and size in Report.

Andrei
Re: DrawPolygon in Report [message #6939 is a reply to message #6919] Tue, 05 December 2006 13:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Would you mind creating a simple test-case?

Mirek
Re: DrawPolygon in Report [message #6940 is a reply to message #6939] Tue, 05 December 2006 15:08 Go to previous messageGo to next message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
A simple testcase (in Reference/Report):
Vector<Point> poly;
 poly<<Point(200,200)<<Point(700,200)<<Point(700,500)<<Point(200,500)<<Point(200,200);
 r.DrawPolygon(poly,Cyan,2,Red,0,Null);



Andrei
Re: DrawPolygon in Report [message #6948 is a reply to message #6940] Tue, 05 December 2006 17:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, fixed.

Quick patch:

Draw/Drawing.cpp 420

static void wsDrawPolyPolyPolygon(Draw& w, Stream& stream, const DrawingPos& dp)
{
	Color color, outline, doxor;
	uint64 pattern;
	int width, vertex_count, subpolygon_count_count, disjunct_polygon_count_count;
	int version = 2;
	stream / version;
	stream % color % width % outline % pattern % doxor;
	stream % vertex_count % subpolygon_count_count % disjunct_polygon_count_count;
	Buffer<Point> vertices(vertex_count);
	Buffer<int> subpolygon_counts(subpolygon_count_count);
	Buffer<int> disjunct_polygon_counts(disjunct_polygon_count_count);
	StreamUnpackPoints(stream, vertices, vertex_count);
	StreamUnpackInts(stream, subpolygon_counts, subpolygon_count_count);
	StreamUnpackInts(stream, disjunct_polygon_counts, disjunct_polygon_count_count);
	if(!dp.Identity()) {
		for(Point *p = vertices, *e = p + vertex_count; p < e; p++)
			dp.Transform(*p);
		dp.TransformW(width);
	}
	w.DrawPolyPolyPolygon(vertices, vertex_count,
		                  subpolygon_counts, subpolygon_count_count,
		                  disjunct_polygon_counts, disjunct_polygon_count_count,
		                  color, width, outline, pattern, doxor);
}


Mirek
Re: DrawPolygon in Report [message #6949 is a reply to message #6948] Tue, 05 December 2006 17:25 Go to previous message
andrei-catalin is currently offline  andrei-catalin
Messages: 62
Registered: May 2006
Location: Romania
Member
Thank you very much!

DrawPolygon is a very easy solution to implement DrawPie.

Andrei
Previous Topic: load image from file: Different colors on different OS
Next Topic: DrawPolygon in PDF bug
Goto Forum:
  


Current Time: Fri Mar 29 01:10:23 CET 2024

Total time taken to generate the page: 0.01438 seconds