From: Sam Moore Date: Wed, 6 Aug 2014 10:14:14 +0000 (+0800) Subject: Merge branch 'master' of git.ucc.asn.au:/ipdf/code X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=commitdiff_plain;h=e63e9c9efda937cb9e2bb60e52cfd07c69c68d27;hp=7a83af96414ff156f56455ff7a5e7af01fc403b5 Merge branch 'master' of git.ucc.asn.au:/ipdf/code At least I set my time correctly this time. ho ho. --- 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) diff --git a/src/view.cpp b/src/view.cpp index 54e4155..496b3b0 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -215,13 +215,13 @@ void View::RenderRange(int width, int height, unsigned first_obj, unsigned last_ if (m_use_gpu_transform) { GLfloat glbounds[] = {static_cast(Float(m_bounds.x)), static_cast(Float(m_bounds.y)), static_cast(Float(m_bounds.w)), static_cast(Float(m_bounds.h)), - 0.0, 0.0, 640.0, 480.0}; + 0.0, 0.0, static_cast(width), static_cast(height)}; m_bounds_ubo.Upload(sizeof(float)*8, glbounds); } else { GLfloat glbounds[] = {0.0f, 0.0f, 1.0f, 1.0f, - 0.0f, 0.0f, 640.0f, 480.0f}; + 0.0f, 0.0f, float(width), float(height)}; m_bounds_ubo.Upload(sizeof(float)*8, glbounds); } m_bounds_dirty = false;