mirror of
https://github.com/ohwgiles/laminar.git
synced 2024-10-27 20:34:20 +00:00
badge svg: define root element dimensions
This prevents default 300x150 sizing
This commit is contained in:
parent
b4df6f5c02
commit
787f8f1681
@ -815,7 +815,7 @@ bool Laminar::handleBadgeRequest(std::string job, std::string &badge) {
|
|||||||
char* svg = NULL;
|
char* svg = NULL;
|
||||||
asprintf(&svg,
|
asprintf(&svg,
|
||||||
R"x(
|
R"x(
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
<svg xmlns="http://www.w3.org/2000/svg" width="%d" height="20">
|
||||||
<clipPath id="clip">
|
<clipPath id="clip">
|
||||||
<rect width="%d" height="20" rx="4"/>
|
<rect width="%d" height="20" rx="4"/>
|
||||||
</clipPath>
|
</clipPath>
|
||||||
@ -833,7 +833,7 @@ R"x(
|
|||||||
<rect x="%d" width="%d" height="20" fill="url(#status)"/>
|
<rect x="%d" width="%d" height="20" fill="url(#status)"/>
|
||||||
<text x="%d" y="14" fill="#000">%s</text>
|
<text x="%d" y="14" fill="#000">%s</text>
|
||||||
</g>
|
</g>
|
||||||
</svg>)x", jobNameWidth+statusWidth, gradient1, gradient2, jobNameWidth, jobNameWidth/2+1, job.data(), jobNameWidth, statusWidth, jobNameWidth+statusWidth/2, status.data());
|
</svg>)x", jobNameWidth+statusWidth, jobNameWidth+statusWidth, gradient1, gradient2, jobNameWidth, jobNameWidth/2+1, job.data(), jobNameWidth, statusWidth, jobNameWidth+statusWidth/2, status.data());
|
||||||
badge = svg;
|
badge = svg;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user