Browse Source

review canvas drag

Alejandro Toledo 5 years ago
parent
commit
bdd388c502

+ 2 - 1
dist/preview release/what's new.md

@@ -9,7 +9,7 @@
 - Reflection probes can now be used to give accurate shading with PBR ([CraigFeldpsar](https://github.com/craigfeldspar) and ([Sebavan](https://github.com/sebavan/)))
 - Added SubSurfaceScattering on PBR materials ([CraigFeldpsar](https://github.com/craigfeldspar) and ([Sebavan](https://github.com/sebavan/)))
 - Added editing of PBR materials, Post processes and Particle fragment shaders in the node material editor ([Popov72](https://github.com/Popov72))
-- Added Curve editor to manage selected entity's animations and edit animation groups in Inspector ([pixelspace](https://github.com/devpixelspace))
+- Added Curve editor to manage entity's animations and edit animation groups in Inspector ([pixelspace](https://github.com/devpixelspace))
 - Added support in `ShadowGenerator` for fast fake soft transparent shadows ([Popov72](https://github.com/Popov72))
 - Added support for **thin instances** for faster mesh instances. [Doc](https://doc.babylonjs.com/how_to/how_to_use_thininstances) ([Popov72](https://github.com/Popov72))
 
@@ -278,6 +278,7 @@
 - Fix issue in `GLTFLoader._updateBoneMatrices()` where bone rest position was not set. ([drigax](https://github.com/drigax))
 
 ## Breaking changes
+
 - `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))
 - `EffectRenderer.render` now takes a `RenderTargetTexture` or an `InternalTexture` as the output texture and only a single `EffectWrapper` for its first argument ([Popov72](https://github.com/Popov72))
 - Sound's `updateOptions` takes `options.length` and `options.offset` as seconds and not milliseconds ([RaananW](https://github.com/RaananW))

+ 4 - 4
inspector/src/components/actionTabs/tabs/propertyGrids/animations/svgDraggableArea.tsx

@@ -46,7 +46,7 @@ export class SvgDraggableArea extends React.Component<ISvgDraggableAreaProps, {
         this._movedX = 0;
         this._movedY = 0;
         this._dragBuffer = 4;
-        this._draggingMultiplier = 3;
+        this._draggingMultiplier = 10;
 
         this.state = { panX: 0, panY: 0 };
     }
@@ -192,18 +192,18 @@ export class SvgDraggableArea extends React.Component<ISvgDraggableAreaProps, {
         } else {
             directionY = 1; //bottom
         }
-
+        console.log(this._panStop.x - this._panStart.x);
         const bufferX = Math.abs(this._movedX - this._panStop.x);
         const bufferY = Math.abs(this._movedY - this._panStop.y);
 
         let xMulti = 0;
         if (bufferX > this._dragBuffer) {
-            xMulti = this._draggingMultiplier;
+            xMulti = Math.abs(this._panStop.x - this._panStart.x) / this._draggingMultiplier;
         }
 
         let yMulti = 0;
         if (bufferY > this._dragBuffer) {
-            yMulti = this._draggingMultiplier;
+            yMulti = Math.abs(this._panStop.y - this._panStart.y) / this._draggingMultiplier;
         }
 
         this._movedX = this._panStop.x;