diff options
Diffstat (limited to 'src/display/guideline.cpp')
| -rw-r--r-- | src/display/guideline.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/display/guideline.cpp b/src/display/guideline.cpp index 51b2ec38d..99dfcc316 100644 --- a/src/display/guideline.cpp +++ b/src/display/guideline.cpp @@ -94,7 +94,7 @@ static void sp_guideline_render(SPCanvasItem *item, SPCanvasBuf *buf) unsigned int const a = NR_RGBA32_A (gl->rgba); if (gl->is_vertical()) { - int position = gl->point_on_line[Geom::X]; + int position = (int) Inkscape::round(gl->point_on_line[Geom::X]); if (position < buf->rect.x0 || position >= buf->rect.x1) { return; } @@ -111,7 +111,7 @@ static void sp_guideline_render(SPCanvasItem *item, SPCanvasBuf *buf) d += step; } } else if (gl->is_horizontal()) { - int position = gl->point_on_line[Geom::Y]; + int position = (int) Inkscape::round(gl->point_on_line[Geom::Y]); if (position < buf->rect.y0 || position >= buf->rect.y1) { return; } @@ -176,13 +176,13 @@ static void sp_guideline_update(SPCanvasItem *item, NR::Matrix const &affine, un ((SPCanvasItemClass *) parent_class)->update(item, affine, flags); } - gl->point_on_line[Geom::X] = affine[4] +0.5; - gl->point_on_line[Geom::Y] = affine[5] -0.5; + gl->point_on_line[Geom::X] = affine[4]; + gl->point_on_line[Geom::Y] = affine[5]; if (gl->is_horizontal()) { - sp_canvas_update_bbox (item, -1000000, gl->point_on_line[Geom::Y], 1000000, gl->point_on_line[Geom::Y] + 1); + sp_canvas_update_bbox (item, -1000000, (int) Inkscape::round(gl->point_on_line[Geom::Y]), 1000000, (int) Inkscape::round(gl->point_on_line[Geom::Y] + 1)); } else if (gl->is_vertical()) { - sp_canvas_update_bbox (item, gl->point_on_line[Geom::X], -1000000, gl->point_on_line[Geom::X]+1, 1000000); + sp_canvas_update_bbox (item, (int) Inkscape::round(gl->point_on_line[Geom::X]), -1000000, (int) Inkscape::round(gl->point_on_line[Geom::X] + 1), 1000000); } else { sp_canvas_update_bbox (item, -1000000, -1000000, 1000000, 1000000); } |
