diff --git a/examples/img2twit.cpp b/examples/img2twit.cpp index ffda4fc..f27370d 100644 --- a/examples/img2twit.cpp +++ b/examples/img2twit.cpp @@ -648,23 +648,23 @@ static void render(pipi_image_t *dst, { float fx, fy, fr, fg, fb, fs; get_point(i, &fx, &fy, &fr, &fg, &fb, &fs); - dt.insert(K::Point_2(fx, fy)); + dt.insert(K::Point_2(fx + dw * RANGE_X, fy + dh * RANGE_Y)); /* Keep link to point */ lookup[(int)(fx * 2) + dw * RANGE_X * 2 * (int)(fy * 2)] = i; } /* Add fake points to close the triangulation */ - dt.insert(K::Point_2(-dw * RANGE_X, -dh * RANGE_Y)); - dt.insert(K::Point_2(2 * dw * RANGE_X, -dh * RANGE_Y)); - dt.insert(K::Point_2(-dw * RANGE_X, 2 * dh * RANGE_Y)); - dt.insert(K::Point_2(2 * dw * RANGE_X, 2 * dh * RANGE_Y)); + dt.insert(K::Point_2(0, 0)); + dt.insert(K::Point_2(3 * dw * RANGE_X, 0)); + dt.insert(K::Point_2(0, 3 * dh * RANGE_Y)); + dt.insert(K::Point_2(3 * dw * RANGE_X, 3 * dh * RANGE_Y)); for(y = ry; y < ry + rh; y++) { for(x = rx; x < rx + rw; x++) { - K::Point_2 m((float)x * dw * RANGE_X / p->w, - (float)y * dh * RANGE_Y / p->h); + K::Point_2 m((float)x * dw * RANGE_X / p->w + dw * RANGE_X, + (float)y * dh * RANGE_Y / p->h + dh * RANGE_Y); Point_coordinate_vector coords; CGAL::Triple< std::back_insert_iterator, @@ -679,8 +679,8 @@ static void render(pipi_image_t *dst, { float fx, fy, fr, fg, fb, fs; - fx = (*it).first.x(); - fy = (*it).first.y(); + fx = (*it).first.x() - dw * RANGE_X; + fy = (*it).first.y() - dh * RANGE_Y; if(fx < 0 || fy < 0 || fx > dw * RANGE_X - 1 || fy > dh * RANGE_Y - 1)