[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: o_basic.c
User: pcjc2
Date: 06/12/30 09:57:53
Modified: . Tag: noscreen o_basic.c
Log:
* include/prototype.h, src/o_basic.c: Changed variable names and
comments to function inside_region() to allow its use with world
coordinates without apparently swapping top and bottom (which have
different sense in screen and world coords. Now uses {x/y}{min/max}.
Revision Changes Path
No revision
No revision
1.15.2.1 +6 -6 eda/geda/gaf/libgeda/src/o_basic.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: o_basic.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/o_basic.c,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -b -r1.15 -r1.15.2.1
--- o_basic.c 17 Dec 2006 04:14:07 -0000 1.15
+++ o_basic.c 30 Dec 2006 14:57:53 -0000 1.15.2.1
@@ -51,17 +51,17 @@
* This function takes a rectangular region and a point. It will check
* if the point is located in the region or not.
*
- * \param [in] left Left coordinate of the region.
- * \param [in] top Top coordinate of the region.
- * \param [in] right Right coordinate of the region.
- * \param [in] bottom Bottom coordinate of the region.
+ * \param [in] xmin Smaller x coordinate of the region.
+ * \param [in] ymin Smaller y coordinate of the region.
+ * \param [in] xmax Larger x coordinate of the region.
+ * \param [in] ymax Larger y coordinate of the region.
* \param [in] x x coordinate of the point to check.
* \param [in] y y coordinate of the point to check.
* \return 1 if the point is inside the region, 0 otherwise.
*/
-int inside_region(int left, int top, int right, int bottom, int x, int y)
+int inside_region(int xmin, int ymin, int xmax, int ymax, int x, int y)
{
- return ((x >= left && x <= right && y >= top && y <= bottom) ? 1 : 0);
+ return ((x >= xmin && x <= xmax && y >= ymin && y <= ymax) ? 1 : 0);
}
/*! \brief Redraw an object on the screen.
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs