aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-09 08:10:20 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-09 08:10:20 +0100
commit9db7e667ac92531b135104167832c74d30d99ef3 (patch)
treea2b48d07b6cab2c73243f091993e0101968d48bf
parent01541d7c467a50f978477734a1bab4c66ecec14e (diff)
downloadlogdiag-9db7e667ac92531b135104167832c74d30d99ef3.tar.gz
logdiag-9db7e667ac92531b135104167832c74d30d99ef3.tar.xz
logdiag-9db7e667ac92531b135104167832c74d30d99ef3.zip
Add hide_terminals() to LdCanvas.
-rw-r--r--src/ld-canvas.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ld-canvas.c b/src/ld-canvas.c
index c12c2c2..5df3438 100644
--- a/src/ld-canvas.c
+++ b/src/ld-canvas.c
@@ -210,6 +210,7 @@ static gboolean get_object_area (LdCanvas *self, LdDiagramObject *object,
static gboolean object_hit_test (LdCanvas *self, LdDiagramObject *object,
gdouble x, gdouble y);
static void check_terminals (LdCanvas *self, gdouble x, gdouble y);
+static void hide_terminals (LdCanvas *self);
static void queue_draw (LdCanvas *self, LdRectangle *rect);
static void queue_object_draw (LdCanvas *self, LdDiagramObject *object);
static void queue_terminal_draw (LdCanvas *self, LdPoint *terminal);
@@ -984,8 +985,7 @@ check_terminals (LdCanvas *self, gdouble x, gdouble y)
}
}
- if (self->priv->terminal_highlighted)
- queue_terminal_draw (self, &self->priv->terminal);
+ hide_terminals (self);
if (closest_symbol)
{
@@ -993,8 +993,16 @@ check_terminals (LdCanvas *self, gdouble x, gdouble y)
self->priv->terminal = closest_terminal;
queue_terminal_draw (self, &closest_terminal);
}
- else
+}
+
+static void
+hide_terminals (LdCanvas *self)
+{
+ if (self->priv->terminal_highlighted)
+ {
self->priv->terminal_highlighted = FALSE;
+ queue_terminal_draw (self, &self->priv->terminal);
+ }
}
static void