fl-web-component 2.1.11 → 2.1.12
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/dist/fl-web-component.common.js +119 -576
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-flcanvas/components/entityFormatting.js +11 -261
- package/packages/components/com-flcanvas/index.vue +71 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.fl-model-containor[data-v-3ef03e39]{width:100%;height:100%;position:relative;cursor:pointer}[data-v-3ef03e39] .tips-label{width:60px;color:#000;font:12px Helvetica;margin-top:-3em;padding:5px;text-align:center;vertical-align:middle;background-color:khaki}[data-v-3ef03e39] .measure-label{max-width:100px;margin-top:-1em;border:10px;border-radius:5px;padding:3px 10px;cursor:pointer;color:#009bea;background-color:#f4f4f4;-webkit-box-shadow:0 1px 3px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px 1px rgba(0,0,0,.25)}[data-v-3ef03e39] .circle-tag{width:10px;height:10px;margin-top:5px;border-radius:50%;background-color:#ff5000}[data-v-3ef03e39] .measure-label-font{word-break:break-all}[data-v-3ef03e39] .mark-label-img{padding-top:5px;width:20px;height:20px}.loading-overlay[data-v-3ef03e39]{position:absolute;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:1000;opacity:0;visibility:hidden;-webkit-transition:opacity .3s ease,visibility .3s ease;transition:opacity .3s ease,visibility .3s ease}.loading-overlay--visible[data-v-3ef03e39]{opacity:1;visibility:visible}.loading-content[data-v-3ef03e39]{background:#fff;border-radius:12px;padding:30px;text-align:center;-webkit-box-shadow:0 8px 32px rgba(0,0,0,.3);box-shadow:0 8px 32px rgba(0,0,0,.3);min-width:300px;max-width:400px}.loading-spinner[data-v-3ef03e39]{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #409eff;border-radius:50%;-webkit-animation:spin-3ef03e39 1s linear infinite;animation:spin-3ef03e39 1s linear infinite;margin:0 auto 20px}@-webkit-keyframes spin-3ef03e39{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin-3ef03e39{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.loading-text[data-v-3ef03e39]{font-size:16px;font-weight:500;color:#333;margin-bottom:20px}.loading-this.progress-bar[data-v-3ef03e39]{width:100%;height:8px;background-color:#f0f0f0;border-radius:4px;overflow:hidden;margin-bottom:15px}.loading-this.progress-fill[data-v-3ef03e39]{height:100%;background:-webkit-gradient(linear,left top,right top,from(#409eff),to(#67c23a));background:linear-gradient(90deg,#409eff,#67c23a);border-radius:4px;-webkit-transition:width .3s ease;transition:width .3s ease}.loading-details[data-v-3ef03e39]{font-size:12px;color:#666;line-height:1.5}.lil-this.gui{background:hsla(0,0%,100%,.95)!important;border:1px solid #e0e0e0!important;border-radius:8px!important;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15)!important;box-shadow:0 4px 12px rgba(0,0,0,.15)!important;backdrop-filter:blur(10px)!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important}.lil-this.gui .title{background:linear-gradient(135deg,#f8f9fa,#e9ecef)!important;color:#495057!important;border-bottom:1px solid #dee2e6!important;font-weight:600!important;padding:0 12px!important;border-radius:8px 8px 0 0!important}.lil-this.gui .controller{border-bottom:1px solid #f1f3f4!important;background:transparent!important}.lil-this.gui .controller:last-child{border-bottom:none!important}.lil-this.gui .controller .name{color:#495057!important;font-weight:500!important;font-size:12px!important}.lil-this.gui .controller .widget{background:#f8f9fa!important;border:1px solid #ced4da!important;border-radius:4px!important;color:#495057!important}.lil-this.gui .controller .widget:focus,.lil-this.gui .controller .widget:hover{border-color:#80bdff!important;-webkit-box-shadow:0 0 0 2px rgba(0,123,255,.25)!important;box-shadow:0 0 0 2px rgba(0,123,255,.25)!important}.lil-this.gui .controller .widget:focus{outline:none!important}.lil-this.gui .controller input[type=range]{background:#e9ecef!important;height:4px!important;-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;border-radius:2px!important}.lil-this.gui .controller.number .fill{border-right:solid #008de9}.lil-this.gui .controller input[type=range]::-webkit-slider-thumb{background:#007bff!important;border:2px solid #fff!important;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2)!important;box-shadow:0 2px 4px rgba(0,0,0,.2)!important;width:16px!important;height:16px!important;border-radius:50%!important;-webkit-appearance:none!important;appearance:none!important;cursor:pointer!important}.lil-this.gui .controller input[type=range]::-moz-range-thumb{background:#007bff!important;border:2px solid #fff!important;box-shadow:0 2px 4px rgba(0,0,0,.2)!important;width:16px!important;height:16px!important;border-radius:50%!important;cursor:pointer!important}.lil-this.gui .controller .option{background:#fff!important;color:#495057!important;border-bottom:1px solid #f1f3f4!important}.lil-this.gui .controller .option:hover{background:#f8f9fa!important}.lil-this.gui .controller .option:last-child{border-bottom:none!important}.lil-this.gui input:active{background:#e6eff4}.lil-this.gui .controller button{background:linear-gradient(135deg,#007bff,#0056b3)!important;color:#fff!important;border:none!important;border-radius:4px!important;font-weight:500!important;-webkit-transition:all .2s ease!important;transition:all .2s ease!important}.lil-this.gui .controller button:hover{background:linear-gradient(135deg,#0056b3,#004085)!important;-webkit-transform:translateY(-1px)!important;transform:translateY(-1px)!important;-webkit-box-shadow:0 4px 8px rgba(0,123,255,.3)!important;box-shadow:0 4px 8px rgba(0,123,255,.3)!important}.lil-this.gui .controller .color{border:2px solid #fff!important;border-radius:4px!important;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.1)!important;box-shadow:0 2px 4px rgba(0,0,0,.1)!important}.lil-this.gui .controller.number .slider,.lil-this.gui .controller.number .slider:hover{background-color:#e6eff4}.lil-this.gui input,.lil-this.gui input:hover,.lil-this.gui input[type=number]:focus,.lil-this.gui input[type=text]:focus{background:#e6eff4}.lil-this.gui .controller>.name{min-width:25px}.lil-this.gui .controller.number input{color:#2e3136}.lil-this.gui .controller.number .slider:active{background-color:#e6eff4}.lil-this.gui .folder>.title{background:linear-gradient(135deg,#f1f3f4,#e9ecef)!important;color:#495057!important;border-bottom:1px solid #dee2e6!important}.lil-this.gui .folder>.title:before{color:#6c757d!important}.lil-this.gui .folder.closed>.children{display:none!important}#konva-container[data-v-177cbfe4]{z-index:3;width:100%;height:100%;cursor:pointer;overflow:hidden}span[data-v-3fceaac3]{font-weight:bolder}.text[data-v-3fceaac3]{margin-top:20px}.description[data-v-3fceaac3]{margin-bottom:20px}.line[data-v-3fceaac3]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-3fceaac3]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.center .cen span[data-v-3fceaac3],.center .top span[data-v-3fceaac3]{color:#53a8ff;display:inline-block;width:40px;height:40px;text-align:center;line-height:30px;border:1px solid #53a8ff;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-3fceaac3]{margin:10px}.button[data-v-3fceaac3]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-3fceaac3]{font-family:iconfont!important;font-size:50px;font-style:normal;color:#53a8ff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-3fceaac3]:before{content:""}.main_body[data-v-4b17bce0]{position:relative;width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.classification_title[data-v-4b17bce0]{margin:0 0 10px 0;color:#fff;font-size:14px;cursor:default}.toolbar[data-v-4b17bce0]{z-index:10;position:absolute;width:520px;padding:8px 16px;border-radius:6px;-webkit-box-shadow:0 2px 10px 0 rgba(6,29,44,.25);box-shadow:0 2px 10px 0 rgba(6,29,44,.25);background-color:#fff;top:10px;left:50%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:translateX(-50%);transform:translateX(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}.icon_toolbar[data-v-4b17bce0],.text_toolbar[data-v-4b17bce0]{float:left;width:32px;height:32px;padding:0!important;background-repeat:no-repeat;background-size:24px;background-position:50%}.icon_active[data-v-4b17bce0],.icon_toolbar[data-v-4b17bce0]:hover,.text_toolbar[data-v-4b17bce0]:hover{background-color:#eee}[data-v-4b17bce0].icon_color .el-color-picker__trigger{height:24px;margin-top:4px;width:24px!important}[data-v-4b17bce0].el-color-picker--medium,[data-v-4b17bce0].el-color-picker--medium .el-color-picker__trigger{width:24px!important;height:24px!important}.canvas_container[data-v-4b17bce0]{position:relative;width:100%;height:100%;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.canvas_container canvas[data-v-4b17bce0]{position:absolute;left:0}.canvas_container #ctx_front[data-v-4b17bce0]{z-index:5;background-color:transparent}.canvas_container #ctx_back[data-v-4b17bce0]{z-index:3}.canvas_container #ctx_base[data-v-4b17bce0]{z-index:1}#text[data-v-4b17bce0]{position:absolute;z-index:-1;resize:none;outline:none;border:1px dashed #9c9c9c;overflow:hidden;background:transparent;line-height:30px;display:none}#text[data-v-4b17bce0]:hover{border:1px dashed #53a8ff}#svg-component[data-v-2572c0e2],#svg-tigger[data-v-2572c0e2]{cursor:pointer;height:100%;width:100%;position:relative}#toolbar-show[data-v-2572c0e2]{z-index:20;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden;background:#fff}
|
|
1
|
+
@charset "UTF-8";.fl-model-containor[data-v-3ef03e39]{width:100%;height:100%;position:relative;cursor:pointer}[data-v-3ef03e39] .tips-label{width:60px;color:#000;font:12px Helvetica;margin-top:-3em;padding:5px;text-align:center;vertical-align:middle;background-color:khaki}[data-v-3ef03e39] .measure-label{max-width:100px;margin-top:-1em;border:10px;border-radius:5px;padding:3px 10px;cursor:pointer;color:#009bea;background-color:#f4f4f4;-webkit-box-shadow:0 1px 3px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px 1px rgba(0,0,0,.25)}[data-v-3ef03e39] .circle-tag{width:10px;height:10px;margin-top:5px;border-radius:50%;background-color:#ff5000}[data-v-3ef03e39] .measure-label-font{word-break:break-all}[data-v-3ef03e39] .mark-label-img{padding-top:5px;width:20px;height:20px}.loading-overlay[data-v-3ef03e39]{position:absolute;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,.7);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:1000;opacity:0;visibility:hidden;-webkit-transition:opacity .3s ease,visibility .3s ease;transition:opacity .3s ease,visibility .3s ease}.loading-overlay--visible[data-v-3ef03e39]{opacity:1;visibility:visible}.loading-content[data-v-3ef03e39]{background:#fff;border-radius:12px;padding:30px;text-align:center;-webkit-box-shadow:0 8px 32px rgba(0,0,0,.3);box-shadow:0 8px 32px rgba(0,0,0,.3);min-width:300px;max-width:400px}.loading-spinner[data-v-3ef03e39]{width:40px;height:40px;border:4px solid #f3f3f3;border-top:4px solid #409eff;border-radius:50%;-webkit-animation:spin-3ef03e39 1s linear infinite;animation:spin-3ef03e39 1s linear infinite;margin:0 auto 20px}@-webkit-keyframes spin-3ef03e39{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin-3ef03e39{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.loading-text[data-v-3ef03e39]{font-size:16px;font-weight:500;color:#333;margin-bottom:20px}.loading-this.progress-bar[data-v-3ef03e39]{width:100%;height:8px;background-color:#f0f0f0;border-radius:4px;overflow:hidden;margin-bottom:15px}.loading-this.progress-fill[data-v-3ef03e39]{height:100%;background:-webkit-gradient(linear,left top,right top,from(#409eff),to(#67c23a));background:linear-gradient(90deg,#409eff,#67c23a);border-radius:4px;-webkit-transition:width .3s ease;transition:width .3s ease}.loading-details[data-v-3ef03e39]{font-size:12px;color:#666;line-height:1.5}.lil-this.gui{background:hsla(0,0%,100%,.95)!important;border:1px solid #e0e0e0!important;border-radius:8px!important;-webkit-box-shadow:0 4px 12px rgba(0,0,0,.15)!important;box-shadow:0 4px 12px rgba(0,0,0,.15)!important;backdrop-filter:blur(10px)!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important}.lil-this.gui .title{background:linear-gradient(135deg,#f8f9fa,#e9ecef)!important;color:#495057!important;border-bottom:1px solid #dee2e6!important;font-weight:600!important;padding:0 12px!important;border-radius:8px 8px 0 0!important}.lil-this.gui .controller{border-bottom:1px solid #f1f3f4!important;background:transparent!important}.lil-this.gui .controller:last-child{border-bottom:none!important}.lil-this.gui .controller .name{color:#495057!important;font-weight:500!important;font-size:12px!important}.lil-this.gui .controller .widget{background:#f8f9fa!important;border:1px solid #ced4da!important;border-radius:4px!important;color:#495057!important}.lil-this.gui .controller .widget:focus,.lil-this.gui .controller .widget:hover{border-color:#80bdff!important;-webkit-box-shadow:0 0 0 2px rgba(0,123,255,.25)!important;box-shadow:0 0 0 2px rgba(0,123,255,.25)!important}.lil-this.gui .controller .widget:focus{outline:none!important}.lil-this.gui .controller input[type=range]{background:#e9ecef!important;height:4px!important;-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;border-radius:2px!important}.lil-this.gui .controller.number .fill{border-right:solid #008de9}.lil-this.gui .controller input[type=range]::-webkit-slider-thumb{background:#007bff!important;border:2px solid #fff!important;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.2)!important;box-shadow:0 2px 4px rgba(0,0,0,.2)!important;width:16px!important;height:16px!important;border-radius:50%!important;-webkit-appearance:none!important;appearance:none!important;cursor:pointer!important}.lil-this.gui .controller input[type=range]::-moz-range-thumb{background:#007bff!important;border:2px solid #fff!important;box-shadow:0 2px 4px rgba(0,0,0,.2)!important;width:16px!important;height:16px!important;border-radius:50%!important;cursor:pointer!important}.lil-this.gui .controller .option{background:#fff!important;color:#495057!important;border-bottom:1px solid #f1f3f4!important}.lil-this.gui .controller .option:hover{background:#f8f9fa!important}.lil-this.gui .controller .option:last-child{border-bottom:none!important}.lil-this.gui input:active{background:#e6eff4}.lil-this.gui .controller button{background:linear-gradient(135deg,#007bff,#0056b3)!important;color:#fff!important;border:none!important;border-radius:4px!important;font-weight:500!important;-webkit-transition:all .2s ease!important;transition:all .2s ease!important}.lil-this.gui .controller button:hover{background:linear-gradient(135deg,#0056b3,#004085)!important;-webkit-transform:translateY(-1px)!important;transform:translateY(-1px)!important;-webkit-box-shadow:0 4px 8px rgba(0,123,255,.3)!important;box-shadow:0 4px 8px rgba(0,123,255,.3)!important}.lil-this.gui .controller .color{border:2px solid #fff!important;border-radius:4px!important;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.1)!important;box-shadow:0 2px 4px rgba(0,0,0,.1)!important}.lil-this.gui .controller.number .slider,.lil-this.gui .controller.number .slider:hover{background-color:#e6eff4}.lil-this.gui input,.lil-this.gui input:hover,.lil-this.gui input[type=number]:focus,.lil-this.gui input[type=text]:focus{background:#e6eff4}.lil-this.gui .controller>.name{min-width:25px}.lil-this.gui .controller.number input{color:#2e3136}.lil-this.gui .controller.number .slider:active{background-color:#e6eff4}.lil-this.gui .folder>.title{background:linear-gradient(135deg,#f1f3f4,#e9ecef)!important;color:#495057!important;border-bottom:1px solid #dee2e6!important}.lil-this.gui .folder>.title:before{color:#6c757d!important}.lil-this.gui .folder.closed>.children{display:none!important}#konva-container[data-v-aa5e04ac]{z-index:3;width:100%;height:100%;cursor:pointer;overflow:hidden}span[data-v-3fceaac3]{font-weight:bolder}.text[data-v-3fceaac3]{margin-top:20px}.description[data-v-3fceaac3]{margin-bottom:20px}.line[data-v-3fceaac3]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-3fceaac3]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.center .cen span[data-v-3fceaac3],.center .top span[data-v-3fceaac3]{color:#53a8ff;display:inline-block;width:40px;height:40px;text-align:center;line-height:30px;border:1px solid #53a8ff;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-3fceaac3]{margin:10px}.button[data-v-3fceaac3]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-3fceaac3]{font-family:iconfont!important;font-size:50px;font-style:normal;color:#53a8ff;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-3fceaac3]:before{content:""}.main_body[data-v-4b17bce0]{position:relative;width:100%;height:100%;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}.classification_title[data-v-4b17bce0]{margin:0 0 10px 0;color:#fff;font-size:14px;cursor:default}.toolbar[data-v-4b17bce0]{z-index:10;position:absolute;width:520px;padding:8px 16px;border-radius:6px;-webkit-box-shadow:0 2px 10px 0 rgba(6,29,44,.25);box-shadow:0 2px 10px 0 rgba(6,29,44,.25);background-color:#fff;top:10px;left:50%;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:translateX(-50%);transform:translateX(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around}.icon_toolbar[data-v-4b17bce0],.text_toolbar[data-v-4b17bce0]{float:left;width:32px;height:32px;padding:0!important;background-repeat:no-repeat;background-size:24px;background-position:50%}.icon_active[data-v-4b17bce0],.icon_toolbar[data-v-4b17bce0]:hover,.text_toolbar[data-v-4b17bce0]:hover{background-color:#eee}[data-v-4b17bce0].icon_color .el-color-picker__trigger{height:24px;margin-top:4px;width:24px!important}[data-v-4b17bce0].el-color-picker--medium,[data-v-4b17bce0].el-color-picker--medium .el-color-picker__trigger{width:24px!important;height:24px!important}.canvas_container[data-v-4b17bce0]{position:relative;width:100%;height:100%;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.canvas_container canvas[data-v-4b17bce0]{position:absolute;left:0}.canvas_container #ctx_front[data-v-4b17bce0]{z-index:5;background-color:transparent}.canvas_container #ctx_back[data-v-4b17bce0]{z-index:3}.canvas_container #ctx_base[data-v-4b17bce0]{z-index:1}#text[data-v-4b17bce0]{position:absolute;z-index:-1;resize:none;outline:none;border:1px dashed #9c9c9c;overflow:hidden;background:transparent;line-height:30px;display:none}#text[data-v-4b17bce0]:hover{border:1px dashed #53a8ff}#svg-component[data-v-2572c0e2],#svg-tigger[data-v-2572c0e2]{cursor:pointer;height:100%;width:100%;position:relative}#toolbar-show[data-v-2572c0e2]{z-index:20;position:absolute;width:100%;height:100%;top:0;left:0;overflow:hidden;background:#fff}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import bSpline from './bspline';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
+
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
|
|
3
4
|
//rgb转换
|
|
4
5
|
export function decimalToRGBHex(decimalValue) {
|
|
5
6
|
// Ensure the input is a valid integer
|
|
@@ -24,7 +25,7 @@ export function decimalToRGBHex(decimalValue) {
|
|
|
24
25
|
const green = (rgbValue >> 8) & 0xff;
|
|
25
26
|
const blue = rgbValue & 0xff;
|
|
26
27
|
// Convert the RGB components to hexadecimal and format as a string
|
|
27
|
-
|
|
28
|
+
const hex =
|
|
28
29
|
'#' +
|
|
29
30
|
red.toString(16).padStart(2, '0') +
|
|
30
31
|
green.toString(16).padStart(2, '0') +
|
|
@@ -415,6 +416,7 @@ function drawText(recordDxf, entity, group, key, configParams) {
|
|
|
415
416
|
stroke: hex,
|
|
416
417
|
strokeWidth: 0.1,
|
|
417
418
|
shapeType: 'text',
|
|
419
|
+
strokeScaleEnabled: false,
|
|
418
420
|
});
|
|
419
421
|
|
|
420
422
|
if (entity.xScale) {
|
|
@@ -485,8 +487,6 @@ function drawText(recordDxf, entity, group, key, configParams) {
|
|
|
485
487
|
// group.add(dim);
|
|
486
488
|
}
|
|
487
489
|
|
|
488
|
-
function drawHatch(recordDxf, entity, group, key, configParams) {}
|
|
489
|
-
|
|
490
490
|
function drawLwLine(recordDxf, entity, group, key, configParams, lineTypes) {
|
|
491
491
|
let color = entity.color;
|
|
492
492
|
let rgb = decimalToRGBHex(color);
|
|
@@ -501,6 +501,7 @@ function drawLwLine(recordDxf, entity, group, key, configParams, lineTypes) {
|
|
|
501
501
|
for (let i = 0; i < entity.vertices.length; i++) {
|
|
502
502
|
list.push(entity.vertices[i].x);
|
|
503
503
|
list.push(-parseFloat(entity.vertices[i].y));
|
|
504
|
+
computeBoundingBox(entity.vertices[i].x, entity.vertices[i].y)
|
|
504
505
|
}
|
|
505
506
|
let width = 0.2;
|
|
506
507
|
if (entity.width) {
|
|
@@ -773,261 +774,10 @@ export function _GenerateBulgeVertices(vertices, startVtx, endVtx, bulge) {
|
|
|
773
774
|
vertices.push(new THREE.Vector2(endVtx.x, endVtx.y));
|
|
774
775
|
return vertices;
|
|
775
776
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
'255,0,255', //7
|
|
784
|
-
'255,255,255', //8
|
|
785
|
-
'128,128,128', //9
|
|
786
|
-
'192,192,192', //10
|
|
787
|
-
'255,0,0', //11
|
|
788
|
-
'255,120,112', //12
|
|
789
|
-
'192,0,0', //13
|
|
790
|
-
'207,103,96', //14
|
|
791
|
-
'144,0,0', //15
|
|
792
|
-
'144,72,79', //16
|
|
793
|
-
'127,0,0', //17
|
|
794
|
-
'112,56,48', //18
|
|
795
|
-
'79,0,0', //19
|
|
796
|
-
'79,39,32', //20
|
|
797
|
-
'255,56,0', //21
|
|
798
|
-
'255,159,127', //22
|
|
799
|
-
'192,48,0', //23
|
|
800
|
-
'207,127,96', //24
|
|
801
|
-
'144,32,0', //25
|
|
802
|
-
'144,88,64', // 26
|
|
803
|
-
'112,24,0', //27
|
|
804
|
-
'127,72,63', //28
|
|
805
|
-
'79,16,0', //29
|
|
806
|
-
'64,40,31', //30
|
|
807
|
-
'255,127,0', //31
|
|
808
|
-
'255,191,127', //32
|
|
809
|
-
'207,103,0', //33
|
|
810
|
-
'192,151,96', //34
|
|
811
|
-
'159,72,0', //35
|
|
812
|
-
'144,112,79', //36
|
|
813
|
-
'127,63,0', //37
|
|
814
|
-
'127,95,63', //38
|
|
815
|
-
'64,32,0', //39
|
|
816
|
-
'64,55,31', //40
|
|
817
|
-
'255,191,0', // 41
|
|
818
|
-
'255,216,127', //42
|
|
819
|
-
'207,152,0', //43
|
|
820
|
-
'192,175,96', //44
|
|
821
|
-
'144,112,0', //45
|
|
822
|
-
'144,128,64', //46
|
|
823
|
-
'112,88,0', //47
|
|
824
|
-
'127,111,63', //48
|
|
825
|
-
'64,55,0', //49
|
|
826
|
-
'64,63,31', //50
|
|
827
|
-
'255,255,0', //51
|
|
828
|
-
'255,255,112', //52
|
|
829
|
-
'207,200,0', //53
|
|
830
|
-
'192,200,96', //54
|
|
831
|
-
'144,151,0', //55
|
|
832
|
-
'144,151,64', //56
|
|
833
|
-
'144,152,0', //57
|
|
834
|
-
'127,120,63', //58
|
|
835
|
-
'79,72,0', //59
|
|
836
|
-
'79,72,32', //60
|
|
837
|
-
'191,255,0', //61
|
|
838
|
-
'208,255,112', //62
|
|
839
|
-
'144,200,0', //63
|
|
840
|
-
'176,200,96', //64
|
|
841
|
-
'111,151,0', //65
|
|
842
|
-
'128,151,79', //66
|
|
843
|
-
'95,127,0', //67
|
|
844
|
-
'111,127,63', //68
|
|
845
|
-
'48,72,0', //69
|
|
846
|
-
'63,72,31', //70
|
|
847
|
-
'127,255,0', //71
|
|
848
|
-
'191,255,127', //72
|
|
849
|
-
'95,200,0', //73
|
|
850
|
-
'159,200,96', //74
|
|
851
|
-
'64,151,0', //75
|
|
852
|
-
'111,151,64', //76
|
|
853
|
-
'63,120,0', //77
|
|
854
|
-
'95,127,63', //78
|
|
855
|
-
'31,72,0', //79
|
|
856
|
-
'48,72,32', //80
|
|
857
|
-
'63,255,0', //81
|
|
858
|
-
'159,255,127', //82
|
|
859
|
-
'47,200,0', //83
|
|
860
|
-
'127,200,96', //84
|
|
861
|
-
'31,151,0', //85
|
|
862
|
-
'80,151,64', //86
|
|
863
|
-
'31,127,0', //87
|
|
864
|
-
'79,127,63', //88
|
|
865
|
-
'15,72,0', //89
|
|
866
|
-
'47,72,32', //90
|
|
867
|
-
'0,255,0', //91
|
|
868
|
-
'127,255,127', //92
|
|
869
|
-
'0,200,0', //93
|
|
870
|
-
'95,200,95', //94
|
|
871
|
-
'0,151,0', //95
|
|
872
|
-
'79,151,79', //96
|
|
873
|
-
'0,127,0', //97
|
|
874
|
-
'63,127,63', //98
|
|
875
|
-
'0,72,0', //99
|
|
876
|
-
'32,72,32', //100
|
|
877
|
-
'0,255,63', //101
|
|
878
|
-
'127,255,159', //102
|
|
879
|
-
'0,200,47', //103
|
|
880
|
-
'95,200,112', //104
|
|
881
|
-
'0,151,32', //105
|
|
882
|
-
'64,151,95', //106
|
|
883
|
-
'0,120,31', //107
|
|
884
|
-
'63,127,79', //108
|
|
885
|
-
'0,72,15', //109
|
|
886
|
-
'32,72,47', //110
|
|
887
|
-
'0,255,127', //111
|
|
888
|
-
'127,255,191', //112
|
|
889
|
-
'0,200,96', //113
|
|
890
|
-
'95,200,144', //114
|
|
891
|
-
'0,151,64', //115
|
|
892
|
-
'79,151,111', //116
|
|
893
|
-
'0,127,63', //117
|
|
894
|
-
'63,127,95', //118
|
|
895
|
-
'0,72,32', //119
|
|
896
|
-
'31,72,48', //120
|
|
897
|
-
'0,255,191', //121
|
|
898
|
-
'127,255,223', //122
|
|
899
|
-
'0,200,144', //123
|
|
900
|
-
'95,200,175', //124
|
|
901
|
-
'0,151,111', //125
|
|
902
|
-
'79,151,128', //126
|
|
903
|
-
'0,120,95', //127
|
|
904
|
-
'63,127,111', //128
|
|
905
|
-
'0,72,48', //129
|
|
906
|
-
'32,72,63', //130
|
|
907
|
-
'0,255,255', //131
|
|
908
|
-
'127,255,255', //132
|
|
909
|
-
'0,200,207', //133
|
|
910
|
-
'96,200,207', //134
|
|
911
|
-
'0,151,144', //135
|
|
912
|
-
'64,151,144', //136
|
|
913
|
-
'0,127,127', //137
|
|
914
|
-
'63,127,127', //138
|
|
915
|
-
'0,72,79', //139
|
|
916
|
-
'32,72,79', //140
|
|
917
|
-
'0,191,255', //141
|
|
918
|
-
'127,223,255', //142
|
|
919
|
-
'0,152,207', //143
|
|
920
|
-
'96,176,207', //144
|
|
921
|
-
'0,111,144', //145
|
|
922
|
-
'64,128,144', //146
|
|
923
|
-
'0,95,127', //147
|
|
924
|
-
'63,111,127', //148
|
|
925
|
-
'0,55,64', //149
|
|
926
|
-
'31,63,64', //150
|
|
927
|
-
'0,127,255', //151
|
|
928
|
-
'112,184,255', //152
|
|
929
|
-
'0,96,192', //153
|
|
930
|
-
'96,151,207', //154
|
|
931
|
-
'0,72,159', //155
|
|
932
|
-
'79,112,144', //156
|
|
933
|
-
'0,63,127', //157
|
|
934
|
-
'63,95,127', //158
|
|
935
|
-
'0,39,79', //159
|
|
936
|
-
'32,56,79', //160
|
|
937
|
-
'0,63,255', //161
|
|
938
|
-
'127,159,255', //162
|
|
939
|
-
'0,48,207', //163
|
|
940
|
-
'96,127,207', //164
|
|
941
|
-
'0,39,159', //165
|
|
942
|
-
'64,95,144', //166
|
|
943
|
-
'0,24,127', //167
|
|
944
|
-
'63,79,127', //168
|
|
945
|
-
'0,15,64', //169
|
|
946
|
-
'32,47,79', //170
|
|
947
|
-
'0,0,255', //171
|
|
948
|
-
'127,127,255', //172
|
|
949
|
-
'0,0,207', //173
|
|
950
|
-
'95,96,192', //174
|
|
951
|
-
'0,0,144', //175
|
|
952
|
-
'79,72,159', //176
|
|
953
|
-
'0,0,127', //177
|
|
954
|
-
'63,63,127', //178
|
|
955
|
-
'0,0,64', //179
|
|
956
|
-
'32,39,79', //180
|
|
957
|
-
'63,0,255', //181
|
|
958
|
-
'159,127,255', //182
|
|
959
|
-
'47,0,192', //183
|
|
960
|
-
'127,103,207', //184
|
|
961
|
-
'32,0,144', //185
|
|
962
|
-
'80,72,144', //186
|
|
963
|
-
'31,0,127', //187
|
|
964
|
-
'79,63,127', //188
|
|
965
|
-
'15,0,79', //189
|
|
966
|
-
'47,39,79', //190
|
|
967
|
-
'127,0,255', //191
|
|
968
|
-
'191,127,255', //192
|
|
969
|
-
'96,0,207', //193
|
|
970
|
-
'144,103,207', //194
|
|
971
|
-
'79,0,144', //195
|
|
972
|
-
'111,72,144', //196
|
|
973
|
-
'63,0,127', //197
|
|
974
|
-
'95,63,127', //198
|
|
975
|
-
'31,0,64', //199
|
|
976
|
-
'48,39,79', //200
|
|
977
|
-
'191,0,255', //201
|
|
978
|
-
'223,127,255', //202
|
|
979
|
-
'144,0,207', //203
|
|
980
|
-
'175,96,192', //204
|
|
981
|
-
'111,0,144', //205
|
|
982
|
-
'128,72,159', //206
|
|
983
|
-
'95,0,127', //207
|
|
984
|
-
'96,56,112', //208
|
|
985
|
-
'48,0,64', //209
|
|
986
|
-
'64,39,79', //210
|
|
987
|
-
'255,0,255', //211
|
|
988
|
-
'255,127,255', //212
|
|
989
|
-
'192,0,192', //213
|
|
990
|
-
'192,96,192', //214
|
|
991
|
-
'144,0,144', //215
|
|
992
|
-
'144,72,144', //216
|
|
993
|
-
'127,0,127', //217
|
|
994
|
-
'127,63,127', //218
|
|
995
|
-
'79,0,79', //219
|
|
996
|
-
'64,32,64', //220
|
|
997
|
-
'255,0,191', //221
|
|
998
|
-
'255,127,223', //222
|
|
999
|
-
'192,0,144', //223
|
|
1000
|
-
'192,96,175', //224
|
|
1001
|
-
'144,0,111', //225
|
|
1002
|
-
'144,72,128', //226
|
|
1003
|
-
'127,0,95', //227
|
|
1004
|
-
'127,56,111', //228
|
|
1005
|
-
'64,0,48', //229
|
|
1006
|
-
'79,39,63', //230
|
|
1007
|
-
'255,0,127', //231
|
|
1008
|
-
'255,127,191', //232
|
|
1009
|
-
'192,0,95', //233
|
|
1010
|
-
'192,96,144', //234
|
|
1011
|
-
'159,0,79', //235
|
|
1012
|
-
'144,72,111', //236
|
|
1013
|
-
'127,0,63', //237
|
|
1014
|
-
'127,63,95', //238
|
|
1015
|
-
'64,0,31', //239
|
|
1016
|
-
'64,32,48', //240
|
|
1017
|
-
'255,0,63', //241
|
|
1018
|
-
'255,127,159', //242
|
|
1019
|
-
'207,0,48', //243
|
|
1020
|
-
'207,103,127', //244
|
|
1021
|
-
'144,0,32', //245
|
|
1022
|
-
'144,72,95', //246
|
|
1023
|
-
'127,0,31', //247
|
|
1024
|
-
'127,63,79', //248
|
|
1025
|
-
'79,0,15', //249
|
|
1026
|
-
'64,32,47', //250
|
|
1027
|
-
'47,47,47', //251
|
|
1028
|
-
'80,88,80', //252
|
|
1029
|
-
'128,128,128', //253
|
|
1030
|
-
'175,175,175', //254
|
|
1031
|
-
'208,215,208', //255
|
|
1032
|
-
'255,255,255', //256
|
|
1033
|
-
];
|
|
777
|
+
|
|
778
|
+
function computeBoundingBox(x, y) {
|
|
779
|
+
if (x < minX) minX = x;
|
|
780
|
+
if (x > maxX) maxX = x;
|
|
781
|
+
if (y < minY) minY = y;
|
|
782
|
+
if (y > maxY) maxY = y;
|
|
783
|
+
}
|
|
@@ -61,6 +61,7 @@ export default {
|
|
|
61
61
|
this.konvaStage = null;
|
|
62
62
|
this.konvaLayer = null;
|
|
63
63
|
this.recordLayerConfig = {};
|
|
64
|
+
this.drawingGroup = null;
|
|
64
65
|
this.activedSvgPan = {
|
|
65
66
|
x: 0,
|
|
66
67
|
y: 0,
|
|
@@ -187,6 +188,28 @@ export default {
|
|
|
187
188
|
methods: {
|
|
188
189
|
// 图纸居中展示
|
|
189
190
|
centerDraw() {
|
|
191
|
+
// let canvasWidth = this.konvaStage.width();
|
|
192
|
+
// let canvasHeight = this.konvaStage.height();
|
|
193
|
+
// const groupBounds = this.drawingGroup.getClientRect({ skipTransform: true });
|
|
194
|
+
// const bboxWidth = groupBounds.width || 1;
|
|
195
|
+
// const bboxHeight = groupBounds.height || 1;
|
|
196
|
+
|
|
197
|
+
// // 计算缩放和平移
|
|
198
|
+
// const padding = 0.5;
|
|
199
|
+
// const scale = Math.min(
|
|
200
|
+
// (canvasWidth - padding * 2) / bboxWidth,
|
|
201
|
+
// (canvasHeight - padding * 2) / bboxHeight
|
|
202
|
+
// );
|
|
203
|
+
// const offsetX = (canvasWidth - bboxWidth * scale) / 2 - groupBounds.x * scale;
|
|
204
|
+
// const offsetY = (canvasHeight - bboxHeight * scale) / 2 - groupBounds.y * scale;
|
|
205
|
+
|
|
206
|
+
// // 应用变换
|
|
207
|
+
// this.drawingGroup.x(offsetX);
|
|
208
|
+
// this.drawingGroup.y(offsetY);
|
|
209
|
+
// this.drawingGroup.scaleX(scale);
|
|
210
|
+
// this.drawingGroup.scaleY(scale);
|
|
211
|
+
// this.konvaStage.batchDraw()
|
|
212
|
+
// return
|
|
190
213
|
if (this.bounds) {
|
|
191
214
|
const { scale, x, y } = this.calculateScaleAndPosition(
|
|
192
215
|
this.bounds,
|
|
@@ -203,6 +226,7 @@ export default {
|
|
|
203
226
|
},
|
|
204
227
|
calculateScaleAndPosition(contentBounds, stageWidth, stageHeight, padding = 0.1) {
|
|
205
228
|
// 1. 计算内容的实际宽高
|
|
229
|
+
console.log(stageWidth, stageHeight)
|
|
206
230
|
const contentWidth = contentBounds.maxX - contentBounds.minX;
|
|
207
231
|
const contentHeight = contentBounds.maxY - contentBounds.minY;
|
|
208
232
|
|
|
@@ -243,6 +267,22 @@ export default {
|
|
|
243
267
|
|
|
244
268
|
return { scale, x, y };
|
|
245
269
|
},
|
|
270
|
+
calTransform(bbox, canvasWidth, canvasHeight, padding = 1) {
|
|
271
|
+
const drawingWidth = bbox.maxX - bbox.minX || 1;
|
|
272
|
+
const drawingHeight = bbox.maxY - bbox.minY || 1;
|
|
273
|
+
const availableWidth = canvasWidth - padding * 2;
|
|
274
|
+
const availableHeight = canvasHeight - padding * 2;
|
|
275
|
+
const scale = Math.min(availableWidth / drawingWidth, availableHeight / drawingHeight);
|
|
276
|
+
const scaledWidth = drawingWidth * scale;
|
|
277
|
+
const scaledHeight = drawingHeight * scale;
|
|
278
|
+
const offsetX = (canvasWidth - scaledWidth) / 2 - bbox.minX * scale;
|
|
279
|
+
const offsetY = (canvasHeight - scaledHeight) / 2 - bbox.minY * scale;
|
|
280
|
+
return {
|
|
281
|
+
offsetX,
|
|
282
|
+
offsetY,
|
|
283
|
+
scale
|
|
284
|
+
}
|
|
285
|
+
},
|
|
246
286
|
updateBounds(v) {
|
|
247
287
|
if (this.bounds === null) {
|
|
248
288
|
this.bounds = { minX: v.x, maxX: v.x, minY: v.y, maxY: v.y };
|
|
@@ -288,24 +328,24 @@ export default {
|
|
|
288
328
|
})
|
|
289
329
|
return
|
|
290
330
|
}
|
|
291
|
-
|
|
331
|
+
|
|
292
332
|
//缩放视口
|
|
293
|
-
let scale = 1;
|
|
294
|
-
const boundingRect = this.konvaLayer.getClientRect();
|
|
295
|
-
let ratio = Number((this.$refs.svgDraw?.clientWidth / boundingRect.width).toFixed(1));
|
|
296
|
-
if (ratio > 2) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const boundingScale = this.konvaLayer.getClientRect();
|
|
333
|
+
// let scale = 1;
|
|
334
|
+
// const boundingRect = this.konvaLayer.getClientRect();
|
|
335
|
+
// let ratio = Number((this.$refs.svgDraw?.clientWidth / boundingRect.width).toFixed(1));
|
|
336
|
+
// if (ratio > 2) {
|
|
337
|
+
// scale = Number((boundingRect.width / boundingRect.height).toFixed(1));
|
|
338
|
+
// scale = scale < 2 ? 2 : scale;
|
|
339
|
+
// }
|
|
340
|
+
console.log(this.konvaLayer)
|
|
341
|
+
// const boundingScale = this.konvaLayer.getClientRect();
|
|
302
342
|
//平移视口
|
|
303
|
-
const x =
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const y =
|
|
307
|
-
|
|
308
|
-
|
|
343
|
+
// const x =
|
|
344
|
+
// this.$refs.svgDraw?.clientWidth / 2 -
|
|
345
|
+
// (Math.ceil(boundingScale.width) / 2 + boundingScale.x / 2);
|
|
346
|
+
// const y =
|
|
347
|
+
// this.$refs.svgDraw.clientHeight / 2 -
|
|
348
|
+
// (Math.ceil(boundingScale.height) / 2 + boundingScale.y);
|
|
309
349
|
|
|
310
350
|
// this.konvaStage.scale({
|
|
311
351
|
// x: 2,
|
|
@@ -364,18 +404,10 @@ export default {
|
|
|
364
404
|
let _this = this;
|
|
365
405
|
const parser2 = new DxfParser2();
|
|
366
406
|
let dxf2 = parser2.parseSync(data);
|
|
367
|
-
// const parser = new DxfParser();
|
|
368
|
-
// let dxf = parser.parse(data);
|
|
369
|
-
// 在这里处理数据为空的时候
|
|
370
|
-
// if (dxf.entities.length === 0) {
|
|
371
|
-
// this.$emit('error', {
|
|
372
|
-
// type: 'entityEmpty'
|
|
373
|
-
// })
|
|
374
|
-
// return
|
|
375
|
-
// }
|
|
376
407
|
if (dxf2.entities.length === 0) {
|
|
377
408
|
return false
|
|
378
409
|
}
|
|
410
|
+
let entities = formatEntity(dxf2.entities);
|
|
379
411
|
let hatchEntitys = dxf2.entities.filter(item => item.type === 'HATCH');
|
|
380
412
|
// 处理HATCH部分
|
|
381
413
|
for (let i = 0; i < hatchEntitys.length; i++) {
|
|
@@ -451,6 +483,7 @@ export default {
|
|
|
451
483
|
name: name,
|
|
452
484
|
entityId: entity.layer,
|
|
453
485
|
strokeWidth: 0.2,
|
|
486
|
+
strokeScaleEnabled: false,
|
|
454
487
|
closed: true,
|
|
455
488
|
fill: color,
|
|
456
489
|
stroke: color,
|
|
@@ -459,6 +492,7 @@ export default {
|
|
|
459
492
|
shapeType: 'hatch',
|
|
460
493
|
});
|
|
461
494
|
this.konvaLayer.add(line);
|
|
495
|
+
// this.drawingGroup.add(line);
|
|
462
496
|
}
|
|
463
497
|
} else {
|
|
464
498
|
let boundaryLoops = entity.boundaryLoops;
|
|
@@ -502,7 +536,9 @@ export default {
|
|
|
502
536
|
customColor: color,
|
|
503
537
|
visible: visible,
|
|
504
538
|
shapeType: 'hatch',
|
|
539
|
+
strokeScaleEnabled: false,
|
|
505
540
|
});
|
|
541
|
+
// this.drawingGroup.add(line)
|
|
506
542
|
this.konvaLayer.add(line);
|
|
507
543
|
}
|
|
508
544
|
}
|
|
@@ -511,7 +547,7 @@ export default {
|
|
|
511
547
|
// }
|
|
512
548
|
}
|
|
513
549
|
//加载图纸
|
|
514
|
-
|
|
550
|
+
|
|
515
551
|
for (let key in entities) {
|
|
516
552
|
if (entities[key]) {
|
|
517
553
|
let group = [];
|
|
@@ -554,7 +590,8 @@ export default {
|
|
|
554
590
|
entityId: key,
|
|
555
591
|
stroke: colorKey,
|
|
556
592
|
customColor: configParams ? configParams.color : colorKey,
|
|
557
|
-
|
|
593
|
+
strokeScaleEnabled: false, // 加上这句是当坐标点巨大时也能正常显示
|
|
594
|
+
// visible: configParams ? configParams.visible : true,
|
|
558
595
|
sceneFunc(context, shape) {
|
|
559
596
|
context.beginPath();
|
|
560
597
|
for (let i = 0; i < entityColorGroup.length; i++) {
|
|
@@ -603,12 +640,11 @@ export default {
|
|
|
603
640
|
context.lineTo(x, y);
|
|
604
641
|
}
|
|
605
642
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
}
|
|
643
|
+
}
|
|
644
|
+
if (closed) {
|
|
645
|
+
/// if (j === points.length - 1) {
|
|
646
|
+
context.lineTo(points[0], points[1]);
|
|
647
|
+
// }
|
|
612
648
|
}
|
|
613
649
|
if (entity.lineType === 'DASH') {
|
|
614
650
|
context.setLineDash(entity.dash)
|
|
@@ -622,6 +658,7 @@ export default {
|
|
|
622
658
|
});
|
|
623
659
|
if (this.konvaLayer) {
|
|
624
660
|
this.konvaLayer.add(customShape);
|
|
661
|
+
// this.drawingGroup.add(customShape)
|
|
625
662
|
// 直接在这里调用draw 能拿到最新数据 不执行的话 就会导致最后执行 导致bounds的数据出错
|
|
626
663
|
this.konvaLayer.draw()
|
|
627
664
|
};
|
|
@@ -630,6 +667,7 @@ export default {
|
|
|
630
667
|
|
|
631
668
|
}
|
|
632
669
|
}
|
|
670
|
+
// 计算
|
|
633
671
|
return true
|
|
634
672
|
},
|
|
635
673
|
toPdfs(list) {
|