X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fobjectrenderer.cpp;h=0770e46424d7b97fd8f1f816cbce19ee42c9a297;hp=a5cd62588c50fefba5bbb50dfcd9af1e719e44a3;hb=9e1a33043e1242c4605f2a3a48bd948fc760d948;hpb=f71f97f4fd251d02882ace4be3ead033ced434c4 diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index a5cd625..0770e46 100644 --- a/src/objectrenderer.cpp +++ b/src/objectrenderer.cpp @@ -179,17 +179,16 @@ void CircleFilledRenderer::RenderUsingCPU(const Objects & objects, const View & { for (int64_t y = max(0L, bounds.y); y <= min(bounds.y + bounds.h, target.h-1); ++y) { - double dx = 2.0*(double)(x - centre_x)/(double)(bounds.w); - double dy = 2.0*(double)(y - centre_y)/(double)(bounds.h); + Real dx(2); dx *= Real(x - centre_x)/Real(bounds.w); + Real dy(2); dy *= Real(y - centre_y)/Real(bounds.h); int64_t index = (x+target.w*y)*4; - if (dx*dx + dy*dy <= 1.0) + if (dx*dx + dy*dy <= Real(1)) { target.pixels[index+0] = 0; target.pixels[index+1] = 0; target.pixels[index+2] = 0; target.pixels[index+3] = 255; - } } }