X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fobjectrenderer.cpp;h=fe97afd29516aa4e483d5b437bf019d3ee21e150;hp=f2f0fdd7aaedaad33b091d9794def54e2ba6d80f;hb=0f3a7a9d2c6cc19852fae8ed048dcd1089d33250;hpb=e7066887c0d142ddef87ec9ae07ef08ff31573dc diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index f2f0fdd..fe97afd 100644 --- a/src/objectrenderer.cpp +++ b/src/objectrenderer.cpp @@ -219,8 +219,8 @@ ObjectRenderer::PixelPoint ObjectRenderer::CPUPointLocation(const Vec2 & point, { // hack... Rect result = view.TransformToViewCoords(Rect(point.x, point.y,1,1)); - int64_t x = result.x*target.w; - int64_t y = result.y*target.h; + int64_t x = Int64(result.x)*target.w; + int64_t y = Int64(result.y)*target.h; return PixelPoint(x,y); } @@ -239,7 +239,7 @@ void BezierRenderer::RenderBezierOnCPU(unsigned i, Objects & objects, const View ObjectRenderer::RenderLineOnCPU(pix_bounds.x+pix_bounds.w, pix_bounds.y, pix_bounds.x+pix_bounds.w, pix_bounds.y+pix_bounds.h, target, Colour(0,255,0,0)); } - unsigned blen = min(max(2U, (unsigned)(target.w/view.GetBounds().w)), + unsigned blen = min(max(2U, (unsigned)Int64(Real(target.w)/view.GetBounds().w)), min((unsigned)(pix_bounds.w+pix_bounds.h)/4 + 1, 100U)); // DeCasteljau Divide the Bezier @@ -260,7 +260,7 @@ void BezierRenderer::RenderBezierOnCPU(unsigned i, Objects & objects, const View while (divisions.size() > 0) { Bezier & current = divisions.front(); - RenderLineOnCPU(current.x0, current.y0, current.x3, current.y3, target, c); + RenderLineOnCPU(Int64(current.x0), Int64(current.y0), Int64(current.x3), Int64(current.y3), target, c); divisions.pop(); } } @@ -384,7 +384,7 @@ void PathRenderer::RenderUsingCPU(Objects & objects, const View & view, const CP Rect bounds(CPURenderBounds(objects.bounds[m_indexes[i]], view, target)); PixelBounds pix_bounds(bounds); - const Path & path = objects.paths[objects.data_indices[m_indexes[i]]]; + Path & path = objects.paths[objects.data_indices[m_indexes[i]]]; if (view.ShowingFillPoints()) { @@ -407,10 +407,11 @@ void PathRenderer::RenderUsingCPU(Objects & objects, const View & view, const CP if (pix_bounds.w*pix_bounds.h > 100) { + vector & fill_points = path.FillPoints(objects, view); Debug("High resolution; use fill points %u,%u", pix_bounds.w, pix_bounds.h); - for (unsigned f = 0; f < path.m_fill_points.size(); ++f) + for (unsigned f = 0; f < fill_points.size(); ++f) { - PixelPoint fill_point(CPUPointLocation(path.m_fill_points[f], view, target)); + PixelPoint fill_point(CPUPointLocation(fill_points[f], view, target)); FloodFillOnCPU(fill_point.first, fill_point.second, pix_bounds, target, path.m_fill, path.m_stroke); }