]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/widgets/BasicBlockWidget.cxx
Fix redraw bug -- call prepareGeometryChange()
[frida/frida.git] / src / gui / widgets / BasicBlockWidget.cxx
index eee78c4ea55d06b47e672afeb10367967b3e8a30..e08cba5e86ac394751f7e3db3d6ac88f14ab88fc 100644 (file)
@@ -235,6 +235,7 @@ void BasicBlockWidget::populateWidget() {
        QGraphicsTextItem* item = _widget.get();
        item->setDocument(document);
        item->adjustSize();
        QGraphicsTextItem* item = _widget.get();
        item->setDocument(document);
        item->adjustSize();
+       updateSize();
 }
 
 QString BasicBlockWidget::formatComments(Instruction* inst) {
 }
 
 QString BasicBlockWidget::formatComments(Instruction* inst) {
@@ -245,11 +246,16 @@ QString BasicBlockWidget::formatComments(Instruction* inst) {
        return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
 }
 
        return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
 }
 
-void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,
-                  QWidget*) {
+void BasicBlockWidget::updateSize() {
+       prepareGeometryChange();
        width = 10 + _widget->boundingRect().width();
        height = 25 + _widget->boundingRect().height();
        if (width < 250) width = 250;
        width = 10 + _widget->boundingRect().width();
        height = 25 + _widget->boundingRect().height();
        if (width < 250) width = 250;
+}
+
+void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,
+                  QWidget*) {
+       updateSize();
 
        painter->fillRect(0, 0, width, height, currentColor);
        painter->setPen(QColor(0x00, 0x00, 0xff, 0xff));
 
        painter->fillRect(0, 0, width, height, currentColor);
        painter->setPen(QColor(0x00, 0x00, 0xff, 0xff));