Socket
Socket
Sign inDemoInstall

dxf-viewer

Package Overview
Dependencies
4
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.17 to 1.0.18

2

package.json
{
"name": "dxf-viewer",
"version": "1.0.17",
"version": "1.0.18",
"description": "JavaScript DXF file viewer",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -384,5 +384,11 @@ import * as three from "three"

controls.mouseButtons = {
LEFT: three.MOUSE.PAN
LEFT: three.MOUSE.PAN,
MIDDLE: three.MOUSE.DOLLY
}
controls.touches = {
ONE: three.TOUCH.PAN,
TWO: three.TOUCH.DOLLY_PAN
}
controls.zoomSpeed = 3
controls.mouseZoomSpeedFactor = 0.05
controls.target = new three.Vector3(this.camera.position.x, this.camera.position.y, 0)

@@ -389,0 +395,0 @@ controls.addEventListener("change", () => {

@@ -54,2 +54,3 @@ // Forked from three/examples/js/controls/OrbitControls.js to implement additional features (e.g.

this.zoomSpeed = 1.0;
this.mouseZoomSpeedFactor = 1;

@@ -342,2 +343,3 @@ // Set to false to disable rotating

var dollyCenter = new THREE.Vector2();
var dollyStart = new THREE.Vector2();

@@ -353,5 +355,5 @@ var dollyEnd = new THREE.Vector2();

function getZoomScale() {
function getZoomScale( isMouseMovement ) {
return Math.pow( 0.95, scope.zoomSpeed );
return Math.pow( 0.95, scope.zoomSpeed * ( isMouseMovement ? scope.mouseZoomSpeedFactor : 1 ));

@@ -518,2 +520,4 @@ }

const canvasRect = scope.domElement.getBoundingClientRect();
dollyCenter.set( event.clientX - canvasRect.left, event.clientY - canvasRect.top );
dollyStart.set( event.clientX, event.clientY );

@@ -555,7 +559,7 @@

dollyOut( getZoomScale() );
dollyOut( getZoomScale(true), dollyCenter );
} else if ( dollyDelta.y < 0 ) {
dollyIn( getZoomScale() );
dollyIn( getZoomScale(true), dollyCenter );

@@ -685,2 +689,6 @@ }

function handleTouchStartDolly( event ) {
const canvasRect = scope.domElement.getBoundingClientRect();
dollyCenter.set(
(event.touches[0].clientX + event.touches[1].clientX) / 2 - canvasRect.left,
(event.touches[0].clientY + event.touches[1].clientY) / 2 - canvasRect.top );

@@ -771,5 +779,5 @@ var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;

dollyDelta.set( 0, Math.pow( dollyEnd.y / dollyStart.y, scope.zoomSpeed ) );
dollyDelta.set( 0, dollyEnd.y / dollyStart.y );
dollyOut( dollyDelta.y );
dollyOut( dollyDelta.y, dollyCenter );

@@ -776,0 +784,0 @@ dollyStart.copy( dollyEnd );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc