diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2019-01-06 15:15:50 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2019-01-06 15:15:50 +0100 |
commit | 6fd94bf97d9f6f6263262d7dd23f8f2c2e33d796 (patch) | |
tree | 65474183784ecf51863b234c69905da17889f07d /src/tikzit.cpp | |
parent | 6cc196eaf2e0af11290c275e8d0c012f06c30147 (diff) |
add a blank node when previewing empty graph
Diffstat (limited to 'src/tikzit.cpp')
-rw-r--r-- | src/tikzit.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tikzit.cpp b/src/tikzit.cpp index 2a7c00a..06777d1 100644 --- a/src/tikzit.cpp +++ b/src/tikzit.cpp @@ -429,7 +429,14 @@ void Tikzit::makePreview() } connect(_latex, SIGNAL(previewFinished()), this, SLOT(cleanupLatex())); - _latex->makePreview(activeWindow()->tikzSource()); + + if (activeWindow()->tikzDocument()->isEmpty()) { + _latex->makePreview("\\begin{tikzpicture}\n" + " \\node [style=none] (0) at (0,0) {};\n" + "\\end{tikzpicture}\n"); + } else { + _latex->makePreview(activeWindow()->tikzSource()); + } _preview->show(); } } |