git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Some really horrible utility Quadtree functions.
[ipdf/code.git]
/
src
/
document.cpp
diff --git
a/src/document.cpp
b/src/document.cpp
index
d097600
..
5890730
100644
(file)
--- 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);
}
UCC
git Repository :: git.ucc.asn.au