Kaydet (Commit) d1698604 authored tarafından Radek Doulik's avatar Radek Doulik

more debug info for emf+ rendering - path

üst 5a8fef9b
...@@ -207,6 +207,7 @@ namespace cppcanvas ...@@ -207,6 +207,7 @@ namespace cppcanvas
if ((pPointTypes [i] & 0x07) == 3) { if ((pPointTypes [i] & 0x07) == 3) {
if (((i - last_normal )% 3) == 1) { if (((i - last_normal )% 3) == 1) {
polygon.setNextControlPoint (p - 1, mapped); polygon.setNextControlPoint (p - 1, mapped);
EMFP_DEBUG (printf ("polygon append next: %d mapped: %f,%f\n", p - 1, mapped.getX (), mapped.getY ()));
continue; continue;
} else if (((i - last_normal) % 3) == 2) { } else if (((i - last_normal) % 3) == 2) {
prev = mapped; prev = mapped;
...@@ -217,14 +218,17 @@ namespace cppcanvas ...@@ -217,14 +218,17 @@ namespace cppcanvas
last_normal = i; last_normal = i;
} }
polygon.append (mapped); polygon.append (mapped);
EMFP_DEBUG (printf ("polygon append point: %f,%f mapped: %f,%f\n", pPoints [i*2], pPoints [i*2 + 1], mapped.getX (), mapped.getY ()));
if (hasPrev) { if (hasPrev) {
polygon.setPrevControlPoint (p, prev); polygon.setPrevControlPoint (p, prev);
EMFP_DEBUG (printf ("polygon append prev: %d mapped: %f,%f\n", p, prev.getX (), prev.getY ()));
hasPrev = false; hasPrev = false;
} }
p ++; p ++;
if (pPointTypes && (pPointTypes [i] & 0x80)) { // closed polygon if (pPointTypes && (pPointTypes [i] & 0x80)) { // closed polygon
polygon.setClosed (true); polygon.setClosed (true);
aPolygon.append (polygon); aPolygon.append (polygon);
EMFP_DEBUG (printf ("close polygon\n"));
last_normal = i + 1; last_normal = i + 1;
p = 0; p = 0;
polygon.clear (); polygon.clear ();
...@@ -234,6 +238,25 @@ namespace cppcanvas ...@@ -234,6 +238,25 @@ namespace cppcanvas
if (polygon.count ()) if (polygon.count ())
aPolygon.append (polygon); aPolygon.append (polygon);
EMFP_DEBUG (
for (unsigned int i=0; i<aPolygon.count(); i++) {
polygon = aPolygon.getB2DPolygon(i);
printf ("polygon: %d\n", i);
for (unsigned int j=0; j<polygon.count(); j++) {
::basegfx::B2DPoint point = polygon.getB2DPoint(j);
printf ("point: %f,%f\n", point.getX(), point.getY());
if (polygon.isPrevControlPointUsed(j)) {
point = polygon.getPrevControlPoint(j);
printf ("prev: %f,%f\n", point.getX(), point.getY());
}
if (polygon.isNextControlPointUsed(j)) {
point = polygon.getNextControlPoint(j);
printf ("next: %f,%f\n", point.getX(), point.getY());
}
}
}
);
return aPolygon; return aPolygon;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment