aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-16 13:44:46 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-16 14:22:21 +0100
commitcb278a2bf1424def11fa129c123478b7eb556fc3 (patch)
tree7b726689e2dafcd0e911b5bbddcbc402b9d1eca0
parent5124cf8d71efe0eeba0951969e587cebd46e045e (diff)
downloadlogdiag-cb278a2bf1424def11fa129c123478b7eb556fc3.tar.gz
logdiag-cb278a2bf1424def11fa129c123478b7eb556fc3.tar.xz
logdiag-cb278a2bf1424def11fa129c123478b7eb556fc3.zip
Use properties instead of accessor methods.
-rw-r--r--liblogdiag/ld-canvas.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/liblogdiag/ld-canvas.c b/liblogdiag/ld-canvas.c
index 9523d9d..a4ac720 100644
--- a/liblogdiag/ld-canvas.c
+++ b/liblogdiag/ld-canvas.c
@@ -880,8 +880,7 @@ move_object_to_coords (LdCanvas *self, LdDiagramObject *object,
gdouble dx, dy;
ld_canvas_widget_to_diagram_coords (self, x, y, &dx, &dy);
- ld_diagram_object_set_x (object, floor (dx + 0.5));
- ld_diagram_object_set_y (object, floor (dy + 0.5));
+ g_object_set (object, "x", floor (dx + 0.5), "y", floor (dy + 0.5), NULL);
}
static LdDiagramObject *
@@ -922,16 +921,13 @@ resolve_diagram_symbol (LdCanvas *self, LdDiagramSymbol *diagram_symbol)
static gboolean
get_symbol_area (LdCanvas *self, LdDiagramSymbol *symbol, LdRectangle *rect)
{
- LdDiagramObject *object;
gdouble object_x, object_y;
LdSymbol *library_symbol;
LdRectangle area;
gdouble x1, x2;
gdouble y1, y2;
- object = LD_DIAGRAM_OBJECT (symbol);
- object_x = ld_diagram_object_get_x (object);
- object_y = ld_diagram_object_get_y (object);
+ g_object_get (symbol, "x", &object_x, "y", &object_y, NULL);
library_symbol = resolve_diagram_symbol (self, symbol);
if (library_symbol)
@@ -1016,8 +1012,7 @@ check_terminals (LdCanvas *self, gdouble x, gdouble y)
continue;
diagram_object = LD_DIAGRAM_OBJECT (iter->data);
- object_x = ld_diagram_object_get_x (diagram_object);
- object_y = ld_diagram_object_get_y (diagram_object);
+ g_object_get (diagram_object, "x", &object_x, "y", &object_y, NULL);
terminals = ld_symbol_get_terminals (symbol);