aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-01-06 03:28:47 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-01-06 03:28:47 +0100
commit53d1de680d6ddf4e0f13383953ac470ae60d65b9 (patch)
tree58341bb72744c10553ac69bbcd9158a4fd749ba4 /src
parent8eba321abe7a074cfe12b153c3f4cf0c81c57ef9 (diff)
downloadlogdiag-53d1de680d6ddf4e0f13383953ac470ae60d65b9.tar.gz
logdiag-53d1de680d6ddf4e0f13383953ac470ae60d65b9.tar.xz
logdiag-53d1de680d6ddf4e0f13383953ac470ae60d65b9.zip
Change symbol clip tolerance to widget units.
As line width is in pixels, too, this makes much more sense.
Diffstat (limited to 'src')
-rw-r--r--src/ld-canvas.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ld-canvas.c b/src/ld-canvas.c
index b0f08a9..e9d7123 100644
--- a/src/ld-canvas.c
+++ b/src/ld-canvas.c
@@ -35,7 +35,7 @@
#define MM_PER_INCH 25.4
/* Tolerance on all sides of symbols for strokes. */
-#define SYMBOL_AREA_CLIP_TOLERANCE 0.5
+#define SYMBOL_AREA_CLIP_TOLERANCE 5
/* The default screen resolution in DPI units. */
#define DEFAULT_SCREEN_RESOLUTION 96
@@ -825,18 +825,18 @@ get_symbol_clip_area_on_widget (LdCanvas *self, LdDiagramSymbol *diagram_symbol,
/* TODO: Rotate the space for other orientations. */
ld_canvas_diagram_to_widget_coords (self,
- object_x + area.x - SYMBOL_AREA_CLIP_TOLERANCE,
- object_y + area.y - SYMBOL_AREA_CLIP_TOLERANCE,
+ object_x + area.x,
+ object_y + area.y,
&x1, &y1);
ld_canvas_diagram_to_widget_coords (self,
- object_x + area.x + area.width + SYMBOL_AREA_CLIP_TOLERANCE,
- object_y + area.y + area.height + SYMBOL_AREA_CLIP_TOLERANCE,
+ object_x + area.x + area.width,
+ object_y + area.y + area.height,
&x2, &y2);
- *x = x1;
- *y = y1;
- *width = x2 - x1;
- *height = y2 - y1;
+ *x = x1 - SYMBOL_AREA_CLIP_TOLERANCE;
+ *y = y1 - SYMBOL_AREA_CLIP_TOLERANCE;
+ *width = x2 - x1 + 2 * SYMBOL_AREA_CLIP_TOLERANCE;
+ *height = y2 - y1 + 2 * SYMBOL_AREA_CLIP_TOLERANCE;
return TRUE;
}