r5924 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Apr 20 04:12:46 CEST 2010


Author: werner
Date: 2010-04-20 04:12:46 +0200 (Tue, 20 Apr 2010)
New Revision: 5924

Modified:
   trunk/eda/fped/inst.c
Log:
The characteristics of the diagonal of the object selected (length and angle)
were taken from the bounding box and thus included silk width and other
confusing things.

- inst.c (rect_status_sort): wrapper for rect_status that sorts the coordinates
  (min/max)
- inst.c (line_op_select, rect_op_select, meas_op_select): display the
  characteristics of the diagonal of the ideal line(s), not of the bounding box
- inst.c (pad_op_select, rpad_op_select): normalize the diagonal by using
  rect_status_sort instead of rect_status. This makes pads behave like silk
  screen objects.



Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c	2010-04-20 01:55:49 UTC (rev 5923)
+++ trunk/eda/fped/inst.c	2010-04-20 02:12:46 UTC (rev 5924)
@@ -548,6 +548,14 @@
 }
 
 
+static void rect_status_sort(struct coord a, struct coord b, unit_type width,
+    int rounded)
+{
+	sort_coord(&a, &b);
+	rect_status(a, b, width, rounded);
+}
+
+
 /* ----- helper functions for instance creation ---------------------------- */
 
 
@@ -756,7 +764,7 @@
 
 static void line_op_select(struct inst *self)
 {
-	rect_status(self->bbox.min, self->bbox.max, self->u.rect.width, 0);
+	rect_status_sort(self->base, self->u.rect.end, self->u.rect.width, 0);
 	obj_line_edit(self->obj);
 }
 
@@ -796,7 +804,7 @@
 
 static void rect_op_select(struct inst *self)
 {
-	rect_status(self->bbox.min, self->bbox.max, self->u.rect.width, 0);
+	rect_status_sort(self->base, self->u.rect.end, self->u.rect.width, 0);
 	obj_rect_edit(self->obj);
 }
 
@@ -853,7 +861,7 @@
 {
 	status_set_type_entry(NULL, "label =");
 	status_set_name("Pad name (actual)", "%s", self->u.pad.name);
-	rect_status(self->base, self->u.pad.other, -1, 0);
+	rect_status_sort(self->base, self->u.pad.other, -1, 0);
 	obj_pad_edit(self->obj);
 }
 
@@ -870,7 +878,7 @@
 {
 	status_set_type_entry(NULL, "label =");
 	status_set_name("Pad name (actual)", "%s", self->u.pad.name);
-	rect_status(self->base, self->u.pad.other, -1, 1);
+	rect_status_sort(self->base, self->u.pad.other, -1, 1);
 	obj_pad_edit(self->obj);
 }
 
@@ -970,7 +978,7 @@
 
 static void meas_op_select(struct inst *self)
 {
-	rect_status(self->bbox.min, self->bbox.max, -1, 0);
+	rect_status_sort(self->base, self->u.meas.end, -1, 0);
 	status_set_type_entry(NULL, "offset =");
 	set_with_units(status_set_name, "", self->u.meas.offset,
 	    "Measurement line offset");




More information about the commitlog mailing list