diff --git a/src/SvgStream.h b/src/SvgStream.h index 88ce99c..ea3b5a0 100644 --- a/src/SvgStream.h +++ b/src/SvgStream.h @@ -125,13 +125,19 @@ class SvgStreamFile : public SvgStream { if (!always_valid) { return; } - - stream_ << "\n"; #ifdef _WIN32 - stream_.seekp(-12, std::ios_base::cur); + int offset = -12; #else - stream_.seekp(-11, std::ios_base::cur); + int offset = -11; #endif + + if (is_clipping()) { + // We don't do newline here just to avoid having to deal with windows + stream_ << ""; + offset -= 4; + } + stream_ << "\n"; + stream_.seekp(offset, std::ios_base::cur); } void finish(bool close) {