Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
f4569ee8
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f4569ee8
编写于
6月 04, 2021
作者:
M
Michael Herzog
提交者:
GitHub
6月 04, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Controls: Remove preventDefault() from mouse handlers. (#21935)
上级
0db8d994
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
7 addition
and
86 deletion
+7
-86
examples/js/controls/DragControls.js
examples/js/controls/DragControls.js
+2
-11
examples/js/controls/FirstPersonControls.js
examples/js/controls/FirstPersonControls.js
+0
-5
examples/js/controls/FlyControls.js
examples/js/controls/FlyControls.js
+1
-12
examples/js/controls/OrbitControls.js
examples/js/controls/OrbitControls.js
+0
-6
examples/js/controls/TrackballControls.js
examples/js/controls/TrackballControls.js
+1
-5
examples/jsm/controls/DragControls.js
examples/jsm/controls/DragControls.js
+2
-12
examples/jsm/controls/FirstPersonControls.js
examples/jsm/controls/FirstPersonControls.js
+0
-6
examples/jsm/controls/FlyControls.js
examples/jsm/controls/FlyControls.js
+0
-12
examples/jsm/controls/OrbitControls.js
examples/jsm/controls/OrbitControls.js
+0
-10
examples/jsm/controls/TrackballControls.js
examples/jsm/controls/TrackballControls.js
+1
-7
未找到文件。
examples/js/controls/DragControls.js
浏览文件 @
f4569ee8
...
...
@@ -81,8 +81,6 @@
function
onPointerMove
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -173,8 +171,6 @@
function
onPointerDown
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -187,9 +183,8 @@
}
function
onMouseDown
(
event
)
{
function
onMouseDown
()
{
event
.
preventDefault
();
_intersections
.
length
=
0
;
_raycaster
.
setFromCamera
(
_mouse
,
_camera
);
...
...
@@ -220,8 +215,6 @@
function
onPointerCancel
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -234,9 +227,7 @@
}
function
onMouseCancel
(
event
)
{
event
.
preventDefault
();
function
onMouseCancel
()
{
if
(
_selected
)
{
...
...
examples/js/controls/FirstPersonControls.js
浏览文件 @
f4569ee8
...
...
@@ -72,8 +72,6 @@
}
event
.
preventDefault
();
if
(
this
.
activeLook
)
{
switch
(
event
.
button
)
{
...
...
@@ -96,8 +94,6 @@
this
.
onMouseUp
=
function
(
event
)
{
event
.
preventDefault
();
if
(
this
.
activeLook
)
{
switch
(
event
.
button
)
{
...
...
@@ -136,7 +132,6 @@
this
.
onKeyDown
=
function
(
event
)
{
//event.preventDefault();
switch
(
event
.
code
)
{
case
'
ArrowUp
'
:
...
...
examples/js/controls/FlyControls.js
浏览文件 @
f4569ee8
...
...
@@ -55,8 +55,7 @@
return
;
}
//event.preventDefault();
}
switch
(
event
.
code
)
{
...
...
@@ -186,14 +185,6 @@
this
.
mousedown
=
function
(
event
)
{
if
(
this
.
domElement
!==
document
)
{
this
.
domElement
.
focus
();
}
event
.
preventDefault
();
if
(
this
.
dragToLook
)
{
this
.
mouseStatus
++
;
...
...
@@ -235,8 +226,6 @@
this
.
mouseup
=
function
(
event
)
{
event
.
preventDefault
();
if
(
this
.
dragToLook
)
{
this
.
mouseStatus
--
;
...
...
examples/js/controls/OrbitControls.js
浏览文件 @
f4569ee8
...
...
@@ -741,11 +741,6 @@
function
onMouseDown
(
event
)
{
// Prevent the browser from scrolling.
event
.
preventDefault
();
// Manually set the focus since calling preventDefault above
// prevents the browser from setting it automatically.
scope
.
domElement
.
focus
?
scope
.
domElement
.
focus
()
:
window
.
focus
();
let
mouseAction
;
switch
(
event
.
button
)
{
...
...
@@ -827,7 +822,6 @@
function
onMouseMove
(
event
)
{
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
switch
(
state
)
{
...
...
examples/js/controls/TrackballControls.js
浏览文件 @
f4569ee8
...
...
@@ -462,8 +462,6 @@
function
onMouseDown
(
event
)
{
event
.
preventDefault
();
if
(
_state
===
STATE
.
NONE
)
{
switch
(
event
.
button
)
{
...
...
@@ -518,7 +516,6 @@
function
onMouseMove
(
event
)
{
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
const
state
=
_keyState
!==
STATE
.
NONE
?
_keyState
:
_state
;
if
(
state
===
STATE
.
ROTATE
&&
!
scope
.
noRotate
)
{
...
...
@@ -539,10 +536,9 @@
}
function
onMouseUp
(
event
)
{
function
onMouseUp
()
{
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
_state
=
STATE
.
NONE
;
scope
.
domElement
.
ownerDocument
.
removeEventListener
(
'
pointermove
'
,
onPointerMove
);
scope
.
domElement
.
ownerDocument
.
removeEventListener
(
'
pointerup
'
,
onPointerUp
);
...
...
examples/jsm/controls/DragControls.js
浏览文件 @
f4569ee8
...
...
@@ -70,8 +70,6 @@ class DragControls extends EventDispatcher {
function
onPointerMove
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -154,8 +152,6 @@ class DragControls extends EventDispatcher {
function
onPointerDown
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -169,9 +165,7 @@ class DragControls extends EventDispatcher {
}
function
onMouseDown
(
event
)
{
event
.
preventDefault
();
function
onMouseDown
()
{
_intersections
.
length
=
0
;
...
...
@@ -200,8 +194,6 @@ class DragControls extends EventDispatcher {
function
onPointerCancel
(
event
)
{
event
.
preventDefault
();
switch
(
event
.
pointerType
)
{
case
'
mouse
'
:
...
...
@@ -215,9 +207,7 @@ class DragControls extends EventDispatcher {
}
function
onMouseCancel
(
event
)
{
event
.
preventDefault
();
function
onMouseCancel
()
{
if
(
_selected
)
{
...
...
examples/jsm/controls/FirstPersonControls.js
浏览文件 @
f4569ee8
...
...
@@ -91,8 +91,6 @@ class FirstPersonControls {
}
event
.
preventDefault
();
if
(
this
.
activeLook
)
{
switch
(
event
.
button
)
{
...
...
@@ -110,8 +108,6 @@ class FirstPersonControls {
this
.
onMouseUp
=
function
(
event
)
{
event
.
preventDefault
();
if
(
this
.
activeLook
)
{
switch
(
event
.
button
)
{
...
...
@@ -145,8 +141,6 @@ class FirstPersonControls {
this
.
onKeyDown
=
function
(
event
)
{
//event.preventDefault();
switch
(
event
.
code
)
{
case
'
ArrowUp
'
:
...
...
examples/jsm/controls/FlyControls.js
浏览文件 @
f4569ee8
...
...
@@ -57,8 +57,6 @@ class FlyControls extends EventDispatcher {
}
//event.preventDefault();
switch
(
event
.
code
)
{
case
'
ShiftLeft
'
:
...
...
@@ -123,14 +121,6 @@ class FlyControls extends EventDispatcher {
this
.
mousedown
=
function
(
event
)
{
if
(
this
.
domElement
!==
document
)
{
this
.
domElement
.
focus
();
}
event
.
preventDefault
();
if
(
this
.
dragToLook
)
{
this
.
mouseStatus
++
;
...
...
@@ -169,8 +159,6 @@ class FlyControls extends EventDispatcher {
this
.
mouseup
=
function
(
event
)
{
event
.
preventDefault
();
if
(
this
.
dragToLook
)
{
this
.
mouseStatus
--
;
...
...
examples/jsm/controls/OrbitControls.js
浏览文件 @
f4569ee8
...
...
@@ -841,14 +841,6 @@ class OrbitControls extends EventDispatcher {
function
onMouseDown
(
event
)
{
// Prevent the browser from scrolling.
event
.
preventDefault
();
// Manually set the focus since calling preventDefault above
// prevents the browser from setting it automatically.
scope
.
domElement
.
focus
?
scope
.
domElement
.
focus
()
:
window
.
focus
();
let
mouseAction
;
switch
(
event
.
button
)
{
...
...
@@ -951,8 +943,6 @@ class OrbitControls extends EventDispatcher {
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
switch
(
state
)
{
case
STATE
.
ROTATE
:
...
...
examples/jsm/controls/TrackballControls.js
浏览文件 @
f4569ee8
...
...
@@ -491,8 +491,6 @@ class TrackballControls extends EventDispatcher {
function
onMouseDown
(
event
)
{
event
.
preventDefault
();
if
(
_state
===
STATE
.
NONE
)
{
switch
(
event
.
button
)
{
...
...
@@ -546,8 +544,6 @@ class TrackballControls extends EventDispatcher {
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
const
state
=
(
_keyState
!==
STATE
.
NONE
)
?
_keyState
:
_state
;
if
(
state
===
STATE
.
ROTATE
&&
!
scope
.
noRotate
)
{
...
...
@@ -567,12 +563,10 @@ class TrackballControls extends EventDispatcher {
}
function
onMouseUp
(
event
)
{
function
onMouseUp
()
{
if
(
scope
.
enabled
===
false
)
return
;
event
.
preventDefault
();
_state
=
STATE
.
NONE
;
scope
.
domElement
.
ownerDocument
.
removeEventListener
(
'
pointermove
'
,
onPointerMove
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录