浏览代码

diglib: increase numerical stability

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@71780 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 年之前
父节点
当前提交
0838296f6c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/vector/diglib/inside.c

+ 1 - 1
lib/vector/diglib/inside.c

@@ -26,7 +26,7 @@ dig_x_intersect(double beg_x,
     /* assumes beg_y != end_y */
 
     /* sort for numerical stability */
-    if (end_y < beg_y) {
+    if (end_x < beg_x || (end_x == beg_x && end_y < beg_y)) {
 	b = end_x;
 	end_x = beg_x;
 	beg_x = b;