Commit 48c6eace authored by dmMaze's avatar dmMaze
Browse files

fix some crash issues

parent 81f6cdd1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ class ControlBlockItem(QGraphicsRectItem):

    def mousePressEvent(self, event: QGraphicsSceneMouseEvent) -> None:
        self.ctrl.ctrlblockPressed()
        if event.button() == Qt.MouseButton.LeftButton:
        if event.button() == Qt.MouseButton.LeftButton and self.ctrl.blk_item is not None:
            blk_item = self.ctrl.blk_item
            blk_item.setSelected(True)
            if self.visible_rect.contains(event.pos()):
+2 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ def layout_lines_aligncenter(
            pos_y = centroid_y - int(blk.bounding_rect()[3] / 2)
        else:
            pos_y = centroid_y + line_height // 2
        pos_y = max(0, min(pos_y, mask.shape[0] - 1))
        top_mean = mask[pos_y, :].mean()
        x_mean = mask.mean(axis=1)
        base_mean = x_mean.max() / 2
@@ -256,6 +257,7 @@ def layout_lines_aligncenter(
        w, wl = wlst_left.pop(-1), len_left.pop(-1)
        pos_x = centroid_x - wl // 2
        pos_y = centroid_y - line_height // 2 - line_height
        pos_y = max(0, min(pos_y, mask.shape[0] - 1))
        line_bottom = pos_y + line_height
        line = Line(w, pos_x, pos_y, wl, spacing)
        lines.insert(0, line)