Skip to content

Commit

Permalink
Use clipPath along with clip-path: url(#GraphRegion)
Browse files Browse the repository at this point in the history
  • Loading branch information
William C Bonner committed Dec 5, 2023
1 parent 3efbf12 commit 38b806a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (POLICY CMP0141)
endif()

project ("influxdbwindsvg"
VERSION 2.20231205.2
VERSION 2.20231205.3
DESCRIPTION "Retrieves Environment Data from Influx Database and creates SVG files"
HOMEPAGE_URL https://github.com/wcbonner/InfluxDBWindSVG
)
Expand Down
5 changes: 3 additions & 2 deletions influxd-wind-svg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,13 @@ void WriteSVG(std::vector<Influx_Pressure>& TheValues, const std::filesystem::pa
SVGFile << "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>" << std::endl;
SVGFile << "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"" << SVGWidth << "\" height=\"" << SVGHeight << "\">" << std::endl;
SVGFile << "\t<!-- Created by: " << ProgramVersionString << " -->" << std::endl;
SVGFile << "\t<!-- TempVerticalFactor: " << TempVerticalFactor << " -->" << std::endl;
SVGFile << "\t<clipPath id=\"GraphRegion\"><polygon points=\"" << GraphLeft << "," << GraphTop << " " << GraphRight << "," << GraphTop << " " << GraphRight << "," << GraphBottom << " " << GraphLeft << "," << GraphBottom << "\" /></clipPath>" << std::endl;
SVGFile << "\t<style>" << std::endl;
SVGFile << "\t\ttext { font-family: sans-serif; font-size: " << FontSize << "px; fill: black; }" << std::endl;
SVGFile << "\t\tline { stroke: black; }" << std::endl;
SVGFile << "\t\tpolygon { fill-opacity: 0.5; }" << std::endl;
SVGFile << "\t\t.barometer-label { font-family: Georgia, serif; font-style: italic; font-size: " << int(TempVerticalFactor * 10) << "px; opacity: 0.5; clip-path: polygon( " << GraphLeft << "px " << GraphTop << "px, " << GraphRight << "px " << GraphTop << "px, " << GraphRight << "px " << GraphBottom << "px, " << GraphLeft << "px " << GraphBottom << "px) view-box; text-anchor: middle; dominant-baseline: middle; }" << std::endl;
SVGFile << "\t\t.barometer-label { font-family: Georgia, serif; font-style: italic; font-size: " << int(TempVerticalFactor * 10) << "px; opacity: 0.5; clip-path: url(#GraphRegion) view-box; text-anchor: middle; dominant-baseline: middle; }" << std::endl;
//SVGFile << "\t\t.barometer-label { font-family: Georgia, serif; font-style: italic; font-size: " << int(TempVerticalFactor * 10) << "px; opacity: 0.5; clip-path: polygon( " << GraphLeft << "px " << GraphTop << "px, " << GraphRight << "px " << GraphTop << "px, " << GraphRight << "px " << GraphBottom << "px, " << GraphLeft << "px " << GraphBottom << "px) view-box; text-anchor: middle; dominant-baseline: middle; }" << std::endl;
#ifdef _DARK_STYLE_
SVGFile << "\t@media only screen and (prefers-color-scheme: dark) {" << std::endl;
SVGFile << "\t\ttext { fill: grey; }" << std::endl;
Expand Down

0 comments on commit 38b806a

Please sign in to comment.