Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
ADIM
Commits
2f14822f
Commit
2f14822f
authored
Nov 09, 2015
by
Julien Furrer
Browse files
Merge branch 'master' into dev
parents
b68156a8
8029512e
Changes
1
Hide whitespace changes
Inline
Side-by-side
adim_project/adim_app/static/_src/adim/tools/select.js
View file @
2f14822f
...
...
@@ -141,8 +141,27 @@ define([
}
}
}
else
if
(
itemHitResult
.
item
.
data
.
type
===
'
lines
'
)
{
// Sur une ligne, aux extrémités, les segments (sommets) peuvent coïncider avec les bounds,
// surtout s'il n'y a que deux points. Il faut allors chercher manuellement les sommets.
var
p1
=
itemHitResult
.
point
,
md
,
ds
,
seg
;
for
(
var
s
=
0
,
l
=
item
.
segments
.
length
;
s
<
l
;
s
++
){
ds
=
p1
.
getDistance
(
item
.
segments
[
s
].
point
);
if
(
!
seg
||
ds
<
md
)
{
seg
=
item
.
segments
[
s
];
md
=
ds
;
}
if
(
ds
==
0
)
{
break
;
}
}
if
(
seg
)
{
_selectedSegment
=
seg
;
}
}
else
{
hitItem
.
onMouseDown
(
event
);
if
(
typeof
hitItem
.
onMouseDown
===
'
function
'
)
hitItem
.
onMouseDown
(
event
);
}
break
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment