X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdocument.cpp;h=589073039f7361164340532fc11da8e13695f70c;hp=d09760046b7e13921c84ba3a75d6567dbc799483;hb=138ee74c900c6f485cdd959d55c01099d6043661;hpb=6472d20ee58d2ecc0aee8bc1a12a071b2afc8a27 diff --git a/src/document.cpp b/src/document.cpp index d097600..5890730 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -105,6 +105,7 @@ int Document::ClipObjectToQuadChild(int object_id, QuadTreeNodeChildren type) { case RECT_FILLED: case RECT_OUTLINE: + case PATH: { Rect obj_bounds = TransformToQuadChild(m_objects.bounds[object_id], type); if (obj_bounds.x < 0) @@ -147,6 +148,7 @@ int Document::ClipObjectToQuadChild(int object_id, QuadTreeNodeChildren type) Rect new_bounds = TransformToQuadChild(m_objects.bounds[object_id], type); Bezier new_curve_data = new_curves[i].ToAbsolute(TransformToQuadChild(m_objects.bounds[object_id],type)); new_bounds = new_curve_data.SolveBounds(); + Debug("New bounds: %s", new_bounds.Str().c_str()); new_curve_data = new_curve_data.ToRelative(new_bounds); unsigned index = AddBezierData(new_curve_data); m_objects.bounds.push_back(new_bounds); @@ -301,6 +303,7 @@ unsigned Document::AddPath(unsigned start_index, unsigned end_index, const Colou unsigned data_index = AddPathData(path); Rect bounds = path.SolveBounds(m_objects); unsigned result = Add(PATH, bounds,data_index); + //Debug("Added path %u -> %u (%u objects) colour {%u,%u,%u,%u}, stroke {%u,%u,%u,%u}", start_index, end_index, (end_index - start_index), fill.r, fill.g, fill.b, fill.a, stroke.r, stroke.g, stroke.b, stroke.a); return result; } @@ -1008,7 +1011,7 @@ void Document::AddFontGlyphAtPoint(stbtt_fontinfo *font, int character, Real sca { AddPath(start_index, end_index); } - Debug("Added Glyph \"%c\" at %f %f, scale %f", (char)character, Float(x), Float(y), Float(scale)); + //Debug("Added Glyph \"%c\" at %f %f, scale %f", (char)character, Float(x), Float(y), Float(scale)); stbtt_FreeShape(font, instructions); }