|
34 | 34 | from project_graph.tools.file_tools import read_file |
35 | 35 |
|
36 | 36 | try: |
37 | | - import project_graph.assets.assets # type: ignore |
38 | | -except: |
| 37 | + pass # type: ignore |
| 38 | +except ImportError: |
39 | 39 | from PyQt5 import pyrcc_main |
40 | 40 |
|
41 | 41 | if not pyrcc_main.processResourceFile( |
|
45 | 45 | ): |
46 | 46 | print("Failed to compile assets.rcc") |
47 | 47 | exit(1) |
48 | | - import project_graph.assets.assets # type: ignore |
49 | 48 |
|
50 | 49 | import os |
51 | 50 |
|
52 | 51 | from project_graph.camera import Camera |
53 | 52 | from project_graph.data_struct.line import Line |
54 | 53 | from project_graph.data_struct.number_vector import NumberVector |
55 | | -from project_graph.data_struct.rectangle import Rectangle |
56 | 54 | from project_graph.effect.effect_concrete import ( |
57 | 55 | EffectCircleExpand, |
58 | 56 | EffectCuttingFlash, |
59 | 57 | EffectRectangleFlash, |
60 | 58 | EffectRectangleShrink, |
61 | 59 | ) |
62 | 60 | from project_graph.effect.effect_manager import EffectManager |
63 | | -from project_graph.entity.entity import Entity |
64 | 61 | from project_graph.entity.entity_node import EntityNode |
65 | 62 | from project_graph.node_manager import NodeManager |
66 | 63 | from project_graph.paint.paint_elements import paint_details_data, paint_grid |
@@ -441,7 +438,6 @@ def mouseMoveEvent(self, a0: QMouseEvent | None): |
441 | 438 | point_world_location = self.camera.location_view2world(point_view_location) |
442 | 439 |
|
443 | 440 | if self.is_dragging: |
444 | | - |
445 | 441 | if a0.buttons() == Qt.MouseButton.LeftButton: |
446 | 442 | # 如果是左键,移动节点 |
447 | 443 | for node in self.drag_list: |
@@ -483,14 +479,13 @@ def mouseMoveEvent(self, a0: QMouseEvent | None): |
483 | 479 |
|
484 | 480 | def mouseReleaseEvent(self, a0: QMouseEvent | None): |
485 | 481 | assert a0 is not None |
486 | | - point_view_location = NumberVector(a0.pos().x(), a0.pos().y()) |
487 | | - point_world_location = self.camera.location_view2world(point_view_location) |
| 482 | + # point_view_location = NumberVector(a0.pos().x(), a0.pos().y()) |
| 483 | + # point_world_location = self.camera.location_view2world(point_view_location) |
488 | 484 | self.is_dragging = False |
489 | 485 |
|
490 | 486 | if a0.button() == Qt.MouseButton.LeftButton: |
491 | 487 | pass |
492 | 488 | if a0.button() == Qt.MouseButton.RightButton: |
493 | | - |
494 | 489 | # 结束连线 |
495 | 490 | if self.connect_from_node is not None and self.connect_to_node is not None: |
496 | 491 | connect_result = self.node_manager.connect_node( |
|
0 commit comments