summaryrefslogtreecommitdiffstats
path: root/src/display/sp-ctrlline.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2009-03-09 00:42:26 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2009-03-09 00:42:26 +0000
commit9f2a6e51f81c3f594165499d45fc08e384a15eff (patch)
tree50ad982600546fbca95a271a08f803f4d6491cb3 /src/display/sp-ctrlline.cpp
parentfor selection modified signal, only update the coords of the selcue boxes, no... (diff)
downloadinkscape-9f2a6e51f81c3f594165499d45fc08e384a15eff.tar.gz
inkscape-9f2a6e51f81c3f594165499d45fc08e384a15eff.zip
for zero-length lines, do not request canvas redraw and do not attempt to draw
(bzr r7448)
Diffstat (limited to 'src/display/sp-ctrlline.cpp')
-rw-r--r--src/display/sp-ctrlline.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/display/sp-ctrlline.cpp b/src/display/sp-ctrlline.cpp
index be0b8d1c6..033c8d1f8 100644
--- a/src/display/sp-ctrlline.cpp
+++ b/src/display/sp-ctrlline.cpp
@@ -103,6 +103,9 @@ sp_ctrlline_render (SPCanvasItem *item, SPCanvasBuf *buf)
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