Skip to content

Commit 827ea4c

Browse files
authored
Merge pull request #11058 from albert-github/feature/issue_11056
issue #11056 HTML: Interactive SVG "viewHeight" is not defined
2 parents 22c1cb7 + 2566bc3 commit 827ea4c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/dotfilepatcher.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@
2626
#include "portable.h"
2727

2828
// top part of the interactive SVG header
29-
static const char svgZoomHeader1[] = R"svg(
29+
static const char svgZoomHeader0[] = R"svg(
3030
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
31+
)svg";
32+
33+
static const char svgZoomHeader0_noinit[] = R"svg(
34+
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
35+
)svg";
36+
37+
static const char svgZoomHeader1[] = R"svg(
3138
<style type="text/css"><![CDATA[
3239
.node, .edge {opacity: 0.7;}
3340
.node.selected, .edge.selected {opacity: 1;}
@@ -364,6 +371,11 @@ bool DotFilePatcher::run() const
364371
{
365372
// insert special replacement header for interactive SVGs
366373
t << "<!--zoomable " << height << " -->\n";
374+
t << svgZoomHeader0;
375+
}
376+
else
377+
{
378+
t << svgZoomHeader0_noinit;
367379
}
368380
t << svgZoomHeader1;
369381
if (useNagivation)

0 commit comments

Comments
 (0)