kopia lustrzana https://github.com/robhawkes/vizicities
Added device pixel ratio support and fixed controls on desktop
rodzic
920ae8b037
commit
cf00340099
|
@ -3146,6 +3146,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
// renderer.setClearColor(Scene.fog.color, 1);
|
||||
|
||||
renderer.setClearColor(0xffffff, 1);
|
||||
renderer.setPixelRatio(window.devicePixelRatio);
|
||||
|
||||
// Gamma settings make things look nicer
|
||||
renderer.gammaInput = true;
|
||||
|
@ -4308,6 +4309,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
return;
|
||||
}
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.pointers.length === 1) {
|
||||
if (scope.enablePan === false) {
|
||||
return;
|
||||
|
@ -4330,11 +4335,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
});
|
||||
|
||||
scope.hammer.on('panend', onTouchEnd);
|
||||
scope.hammer.on('panend', function (event) {
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
onTouchEnd(event);
|
||||
});
|
||||
|
||||
scope.hammer.on('panmove', function (event) {
|
||||
if (scope.enabled === false) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
|
||||
|
@ -4364,6 +4379,10 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
scope.hammer.on('pinchstart', function (event) {
|
||||
if (scope.enabled === false) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (scope.enableZoom === false) return;
|
||||
|
||||
handleTouchStartDolly(event);
|
||||
|
@ -4382,11 +4401,21 @@ return /******/ (function(modules) { // webpackBootstrap
|
|||
}
|
||||
});
|
||||
|
||||
scope.hammer.on('pinchend', onTouchEnd);
|
||||
scope.hammer.on('pinchend', function (event) {
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
onTouchEnd(event);
|
||||
});
|
||||
|
||||
scope.hammer.on('pinchmove', function (event) {
|
||||
if (scope.enabled === false) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -13,6 +13,7 @@ export default function(container) {
|
|||
// renderer.setClearColor(Scene.fog.color, 1);
|
||||
|
||||
renderer.setClearColor(0xffffff, 1);
|
||||
renderer.setPixelRatio(window.devicePixelRatio);
|
||||
|
||||
// Gamma settings make things look nicer
|
||||
renderer.gammaInput = true;
|
||||
|
|
|
@ -963,6 +963,10 @@ var OrbitControls = function ( object, domElement ) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.pointers.length === 1) {
|
||||
if (scope.enablePan === false) {
|
||||
return;
|
||||
|
@ -985,11 +989,21 @@ var OrbitControls = function ( object, domElement ) {
|
|||
}
|
||||
});
|
||||
|
||||
scope.hammer.on('panend', onTouchEnd);
|
||||
scope.hammer.on('panend', function(event) {
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
onTouchEnd(event);
|
||||
});
|
||||
|
||||
scope.hammer.on('panmove', function(event) {
|
||||
if ( scope.enabled === false ) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
|
||||
|
@ -1019,6 +1033,10 @@ var OrbitControls = function ( object, domElement ) {
|
|||
scope.hammer.on('pinchstart', function(event) {
|
||||
if ( scope.enabled === false ) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( scope.enableZoom === false ) return;
|
||||
|
||||
handleTouchStartDolly( event );
|
||||
|
@ -1037,11 +1055,21 @@ var OrbitControls = function ( object, domElement ) {
|
|||
}
|
||||
});
|
||||
|
||||
scope.hammer.on('pinchend', onTouchEnd);
|
||||
scope.hammer.on('pinchend', function(event) {
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
onTouchEnd(event);
|
||||
});
|
||||
|
||||
scope.hammer.on('pinchmove', function(event) {
|
||||
if ( scope.enabled === false ) return;
|
||||
|
||||
if (event.pointerType === 'mouse') {
|
||||
return;
|
||||
}
|
||||
|
||||
// event.preventDefault();
|
||||
// event.stopPropagation();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue