Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
d656f5dc
Commit
d656f5dc
authored
Jun 29, 2017
by
Rurik Bugdanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
#3
parent
81dac4c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
x3dom_init.js
js/x3dom_init.js
+14
-0
No files found.
js/x3dom_init.js
View file @
d656f5dc
...
...
@@ -711,6 +711,7 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
marker
.
on
(
'mousedown'
,
function
(
e
){
var
self
=
this
;
var
elem
=
$
(
this
).
parent
().
parent
().
parent
();
var
index
=
parseInt
(
$
(
elem
).
attr
(
"id"
).
substr
(
PREFIX
.
length
));
...
...
@@ -726,6 +727,13 @@ X3DOMObject.Marker.prototype._registerEvents = function(){
Scene
.
element
.
addEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
Scene
.
element
.
addEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
// check for button released outside the window
$
(
window
).
on
(
'mouseover.drag_marker'
,
function
(
e
)
{
if
(
e
&&
e
.
buttons
===
0
&&
Scene
.
markerToDrag
)
{
X3DOMObject
.
Marker
.
mouseUp
.
apply
(
self
,[
event
]);
}
});
});
...
...
@@ -752,8 +760,10 @@ X3DOMObject.Marker.mouseUp = function(){
}
*/
Scene
.
markerToDrag
=
null
;
Scene
.
element
.
removeEventListener
(
'mouseup'
,
X3DOMObject
.
Marker
.
mouseUp
,
true
);
Scene
.
element
.
removeEventListener
(
'mousemove'
,
X3DOMObject
.
Marker
.
mouseMove
,
true
);
$
(
window
).
off
(
'.drag_marker'
);
Scene
.
draggedTransformNode
=
null
;
Scene
.
draggingUpVec
=
null
;
...
...
@@ -768,6 +778,8 @@ X3DOMObject.Marker.mouseUp = function(){
// from https://x3dom.org/x3dom/example/MovingObjectsWithDOMEvents.html
X3DOMObject
.
Marker
.
dragStart
=
function
(
elem
){
Scene
.
markerToDrag
=
elem
;
// move up from <shape> to <transform>
var
transformNode
=
$
(
elem
).
parent
();
var
tr0
=
$
(
transformNode
).
attr
(
"translation"
);
...
...
@@ -825,7 +837,9 @@ X3DOMObject.Marker.mouseMove = function(event){
if
(
!
SETTINGS
.
slidingdrag
){
X3DOMObject
.
Marker
.
drag
(
event
.
offsetX
-
Scene
.
lastMouseX
,
event
.
offsetY
-
Scene
.
lastMouseY
);
}
else
{
Scene
.
markerToDrag
.
isPickable
=
false
;
var
sr
=
Scene
.
element
.
runtime
.
shootRay
(
event
.
clientX
,
event
.
clientY
);
Scene
.
markerToDrag
.
isPickable
=
true
;
if
(
sr
.
pickObject
!=
null
){
if
(
!
$
(
sr
.
pickObject
).
hasClass
(
"shapemarker"
)){
var
sphere
=
Scene
.
draggedTransformNode
.
parent
().
parent
();
...
...
Write
Preview
Markdown
is supported
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