浏览代码

Preview: fix glitchy PlantUML preview when no background is specified

Le Tan 7 年之前
父节点
当前提交
f9e9735d5f
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/utils/vutils.cpp

+ 4 - 1
src/utils/vutils.cpp

@@ -1748,7 +1748,10 @@ QPixmap VUtils::svgToPixmap(const QByteArray &p_content,
     }
     }
 
 
     QPixmap pm(deSz);
     QPixmap pm(deSz);
-    if (!p_background.isEmpty()) {
+    if (p_background.isEmpty()) {
+        // Fill a transparent background to avoid glitchy preview.
+        pm.fill(QColor(255, 255, 255, 0));
+    } else {
         pm.fill(p_background);
         pm.fill(p_background);
     }
     }