X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fobjectrenderer.cpp;h=d23cd986e89137372f118d3dbc1e441e423e8eae;hp=8b3b7e4658d4afc5be4297021b1fcb8cd74aac3d;hb=993c6ac64d6176f1c3bc71e0fadcc4ed35f4e494;hpb=b85533b9da0dc3f6cdf8e329250518d4ac82e434 diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index 8b3b7e4..d23cd98 100644 --- a/src/objectrenderer.cpp +++ b/src/objectrenderer.cpp @@ -241,7 +241,13 @@ void BezierRenderer::RenderUsingCPU(const Objects & objects, const View & view, Real x[2]; Real y[2]; control.Evaluate(x[0], y[0], Real(0)); - int64_t blen = max((int64_t)2, min((int64_t)100, pix_bounds.w)); + Debug("target is (%lu, %lu)", target.w, target.h); + int64_t blen = 1; + if ((control.x1 != control.x2 || control.y1 != control.y2) + && (control.x1 != control.x0 || control.y1 != control.y0)) + { + blen = min(max((int64_t)2, (int64_t)(target.w/view.GetBounds().w)), (int64_t)100); + } Real invblen(1); invblen /= blen; Debug("Using %li lines, inverse %f", blen, Double(invblen)); for (int64_t j = 1; j <= blen; ++j)