Commit abd070f6 authored by dmMaze's avatar dmMaze
Browse files

fix textblkitem padding

parent 708cc0ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -805,7 +805,7 @@ class HorizontalTextDocumentLayout(SceneTextLayout):
            block = block.next()
        
        if len(self.y_offset_lst) > 0:
            new_height = self.shrink_height - doc_margin
            new_height = self.shrink_height
        else:
            new_height = doc_margin
        if new_height > self.available_height:
@@ -917,7 +917,7 @@ class HorizontalTextDocumentLayout(SceneTextLayout):
            line.setPosition(QPointF(doc_margin, y_offset + dy))
            tw = line.naturalTextWidth()
            shrink_width = max(tw, shrink_width)
            self.shrink_height = max(idea_height + y_offset, self.shrink_height)    #????
            self.shrink_height = max(idea_height + y_offset - doc_margin, self.shrink_height)    #????
            y_offset += idea_height * self.line_spacing
            line_idx += 1
            char_idx += nchar
+2 −4
Original line number Diff line number Diff line
@@ -933,13 +933,11 @@ class TextBlkItem(QGraphicsTextItem):
            if cond_on_alignment:
                mw = br.width()

        if br_w > mw or br_h > mh:

        if np.abs(br_w - mw) > 0.001 or np.abs(br_h - mh) > 0.001:
            P = self.padding() * 2
            mw += P
            mh += P
            mw += P
            self.set_size(mw, mh, set_layout_maxsize=True, set_blk_size=True)
            # self.prepareGeometryChange()
            if self.under_ctrl:
                self.doc_size_changed.emit(self.idx)
            if repaint: