Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-11-06 14:59:36 +0300
committerTon Roosendaal <ton@blender.org>2003-11-06 14:59:36 +0300
commitb1762e85f6cc499c35be05ba0bdc54f819c33636 (patch)
tree22557942ffb7bfe424324359581aa7e170c8d076 /source/blender/src/editscreen.c
parentb961e52f71442d3f0db821c32813525669550e42 (diff)
- fixed bug: removing a window edge (join areas) sometimes found the wrong
edge. this code error was very old... wonder how this error could exist so long
Diffstat (limited to 'source/blender/src/editscreen.c')
-rw-r--r--source/blender/src/editscreen.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/src/editscreen.c b/source/blender/src/editscreen.c
index fd6aeb06ad4..10fdf34e455 100644
--- a/source/blender/src/editscreen.c
+++ b/source/blender/src/editscreen.c
@@ -224,12 +224,19 @@ static ScrEdge *screen_find_active_scredge(bScreen *sc, short *mval)
for (se= sc->edgebase.first; se; se= se->next) {
if (scredge_is_horizontal(se)) {
- if (abs(mval[1]-se->v1->vec.y)<=2 &&
- abs(mval[0]-se->v1->vec.x)<=abs(se->v2->vec.x-se->v1->vec.x))
+ short min, max;
+ min= MIN2(se->v1->vec.x, se->v2->vec.x);
+ max= MAX2(se->v1->vec.x, se->v2->vec.x);
+
+ if (abs(mval[1]-se->v1->vec.y)<=2 && mval[0] >= min && mval[0]<=max)
return se;
- } else {
- if (abs(mval[0]-se->v1->vec.x)<=2 &&
- abs(mval[1]-se->v1->vec.y)<=abs(se->v2->vec.y-se->v1->vec.y))
+ }
+ else {
+ short min, max;
+ min= MIN2(se->v1->vec.y, se->v2->vec.y);
+ max= MAX2(se->v1->vec.y, se->v2->vec.y);
+
+ if (abs(mval[0]-se->v1->vec.x)<=2 && mval[1] >= min && mval[1]<=max)
return se;
}
}