summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 553004a)
raw | patch | inline | side by side (parent: 553004a)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 9 Mar 2009 00:42:26 +0000 (00:42 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 9 Mar 2009 00:42:26 +0000 (00:42 +0000) |
src/display/sp-ctrlline.cpp | patch | blob | history |
index be0b8d1c6e24ceff78fe284d0a81174ccb39831c..033c8d1f80116b419493fabcefc3eb38fd105756 100644 (file)
if (!buf->ct)
return;
+ if (cl->s == cl->e)
+ return;
+
sp_canvas_prepare_buffer (buf);
guint32 rgba = cl->rgba;
@@ -134,15 +137,21 @@ sp_ctrlline_update (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int
cl->affine = affine;
- Geom::Point s = cl->s * affine;
- Geom::Point e = cl->e * affine;
+ if (cl->s == cl->e) {
+ item->x1 = item->x2 = item->y1 = item->y2 = 0;
+ } else {
- item->x1 = round(MIN(s[Geom::X], e[Geom::X]) - 1);
- item->y1 = round(MIN(s[Geom::Y], e[Geom::Y]) - 1);
- item->x2 = round(MAX(s[Geom::X], e[Geom::X]) + 1);
- item->y2 = round(MAX(s[Geom::Y], e[Geom::Y]) + 1);
+ Geom::Point s = cl->s * affine;
+ Geom::Point e = cl->e * affine;
- sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
+ item->x1 = round(MIN(s[Geom::X], e[Geom::X]) - 1);
+ item->y1 = round(MIN(s[Geom::Y], e[Geom::Y]) - 1);
+ item->x2 = round(MAX(s[Geom::X], e[Geom::X]) + 1);
+ item->y2 = round(MAX(s[Geom::Y], e[Geom::Y]) + 1);
+
+ sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
+
+ }
}
void