增加双击中键缩放到全部的特性.
This commit is contained in:
@@ -141,6 +141,9 @@ export class CameraControls
|
||||
this.m_State = CameraControlState.Rotate;
|
||||
this.m_Viewer.UpdateLockTarget();
|
||||
}
|
||||
|
||||
//最后一次按中键的时间
|
||||
lastMiddleClickTime = 0;
|
||||
//鼠标
|
||||
onMouseDown = (event: MouseEvent) =>
|
||||
{
|
||||
@@ -161,6 +164,14 @@ export class CameraControls
|
||||
}
|
||||
case MouseKey.Middle:
|
||||
{
|
||||
let curTime = Date.now();
|
||||
let t = curTime - this.lastMiddleClickTime;
|
||||
this.lastMiddleClickTime = curTime;
|
||||
if (t < 350)
|
||||
{
|
||||
this.m_Viewer.ZoomAll();
|
||||
return;
|
||||
}
|
||||
if (this.m_KeyDown.get(KeyBoard.Control))
|
||||
{
|
||||
this.beginRotate();
|
||||
|
Reference in New Issue
Block a user