X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fpath.cpp;h=cae1e68b399eb9e05096afc9e6a28eefa4760345;hp=04e537cb39d38c1fccf8563c9e6e262cb9f401f6;hb=f0b6c9b6b95fde134927c395afbfbbbc057868e6;hpb=2d12d37f1657d6aef9bb80d735b6c7022aecba6e diff --git a/src/path.cpp b/src/path.cpp index 04e537c..cae1e68 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -54,12 +54,12 @@ Path::Path(Objects & objects, unsigned start, unsigned end, const Colour & fill, m_left = objects.beziers[objects.data_indices[left]].ToAbsolute(objects.bounds[left]).GetLeft(); m_right = objects.beziers[objects.data_indices[right]].ToAbsolute(objects.bounds[right]).GetRight(); + m_bounds = SolveBounds(objects).Convert(); #ifdef TRANSFORM_BEZIERS_TO_PATH - Rect bounds = SolveBounds(objects); for (unsigned i = m_start; i <= m_end; ++i) { //Debug("Transform %s -> %s", objects.bounds[i].Str().c_str(), bounds.Str().c_str()); - objects.bounds[i] = TransformRectCoordinates(bounds, objects.bounds[i]); + objects.bounds[i] = TransformRectCoordinates(m_bounds.Convert(), objects.bounds[i]); //Debug("-> %s", objects.bounds[i].Str().c_str()); } #endif @@ -126,7 +126,7 @@ bool Path::PointInside(const Objects & objects, const Vec2 & pt, bool debug) con vector & Path::FillPoints(const Objects & objects, const View & view) { - if (m_fill_points.size() != 0) + //if (m_fill_points.size() != 0) return m_fill_points; @@ -191,13 +191,14 @@ vector & Path::FillPoints(const Objects & objects, const View & view) return m_fill_points; } -Rect Path::SolveBounds(const Objects & objects) const +Rect Path::SolveBounds(const Objects & objects) { return Rect(m_left.x, m_top.y, m_right.x-m_left.x, m_bottom.y-m_top.y); } Rect & Path::GetBounds(Objects & objects) { + objects.bounds[m_index] = m_bounds.Convert(); return objects.bounds[m_index]; }