build-dxf 0.0.19-4 → 0.0.19-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -3087,6 +3087,7 @@ async function createEditor(dom, camera) {
|
|
|
3087
3087
|
originalLine: false,
|
|
3088
3088
|
modelData: false,
|
|
3089
3089
|
detailsPoint: false,
|
|
3090
|
+
orbitControls: false,
|
|
3090
3091
|
camera
|
|
3091
3092
|
})).usePlugin(editor.Editor);
|
|
3092
3093
|
const domContainer = dxfSystem.findComponentByType(rp.components.DomContainer);
|
package/src/index2.js
CHANGED
|
@@ -630,22 +630,28 @@ class DomEventRegister extends Component {
|
|
|
630
630
|
const domContainer = parent.findComponentByType(DomContainer);
|
|
631
631
|
const variable = parent.findComponentByType(Variable);
|
|
632
632
|
const domElement = domContainer.domElement;
|
|
633
|
-
|
|
634
|
-
|
|
633
|
+
document.body.tabIndex = 1;
|
|
634
|
+
const onKeyup = (e) => {
|
|
635
635
|
const key = e.key.toLocaleLowerCase();
|
|
636
636
|
variable.set("currentKeyUp", key);
|
|
637
637
|
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
638
638
|
const element = this.cancelDefaultBehaviorList[i];
|
|
639
639
|
if (element(e)) e.preventDefault();
|
|
640
640
|
}
|
|
641
|
-
}
|
|
642
|
-
|
|
641
|
+
};
|
|
642
|
+
document.body.addEventListener("keyup", onKeyup);
|
|
643
|
+
const onKeydown = (e) => {
|
|
643
644
|
const key = e.key.toLocaleLowerCase();
|
|
644
645
|
variable.set("currentKeyDown", key);
|
|
645
646
|
for (let i = 0; i < this.cancelDefaultBehaviorList.length; i++) {
|
|
646
647
|
const element = this.cancelDefaultBehaviorList[i];
|
|
647
648
|
if (element(e)) e.preventDefault();
|
|
648
649
|
}
|
|
650
|
+
};
|
|
651
|
+
document.body.addEventListener("keydown", onKeydown);
|
|
652
|
+
this.addEventRecord("destory", () => {
|
|
653
|
+
document.body.removeEventListener("keyup", onKeyup);
|
|
654
|
+
document.body.removeEventListener("keydown", onKeydown);
|
|
649
655
|
});
|
|
650
656
|
domElement.addEventListener("mousedown", (e) => {
|
|
651
657
|
variable.set("currentMouseDown", "mouse_" + e.button);
|
|
@@ -714,6 +720,9 @@ class DomEventRegister extends Component {
|
|
|
714
720
|
});
|
|
715
721
|
callBack({ ...offset }, 0, 0);
|
|
716
722
|
}
|
|
723
|
+
destroy() {
|
|
724
|
+
this.canceEventRecord("destory");
|
|
725
|
+
}
|
|
717
726
|
}
|
|
718
727
|
class EventInput extends Component {
|
|
719
728
|
static name = "EventInput";
|
|
@@ -1021,6 +1030,7 @@ function RenderPlugin_(dxfSystem, option = {}) {
|
|
|
1021
1030
|
originalLine = true,
|
|
1022
1031
|
modelData = true,
|
|
1023
1032
|
detailsPoint = true,
|
|
1033
|
+
orbitControls = true,
|
|
1024
1034
|
camera = new THREE.PerspectiveCamera(45, 1, 0.01, 1e3)
|
|
1025
1035
|
} = option;
|
|
1026
1036
|
const domContainer = new DomContainer();
|
|
@@ -1033,11 +1043,11 @@ function RenderPlugin_(dxfSystem, option = {}) {
|
|
|
1033
1043
|
"3d": domContainer.html3DRenderer
|
|
1034
1044
|
},
|
|
1035
1045
|
resizeObserver: domContainer.domElement,
|
|
1036
|
-
orbitControls: {
|
|
1046
|
+
orbitControls: orbitControls ? {
|
|
1037
1047
|
domElement: domContainer.domElement,
|
|
1038
1048
|
enableDamping: true,
|
|
1039
1049
|
dampingFactor: 0.15
|
|
1040
|
-
}
|
|
1050
|
+
} : void 0
|
|
1041
1051
|
}));
|
|
1042
1052
|
originalLine && dxfSystem.addComponent(new OriginalLineRender());
|
|
1043
1053
|
modelData && dxfSystem.addComponent(new ModelDataRender());
|