MCPcopy Create free account
hub / github.com/Tencent/tgfx / AppendFloat

Method AppendFloat

src/pdf/PDFUtils.cpp:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void PDFUtils::AppendFloat(float value, const std::shared_ptr<WriteStream>& stream) {
163 if (value == INFINITY) {
164 value = FLT_MAX;
165 }
166 if (value == -INFINITY) {
167 value = -FLT_MAX;
168 }
169 if (!std::isfinite(value)) {
170 value = 0.0f; // PDF does not support NaN, so we use 0.0f as a fallback.
171 }
172 auto result = std::to_string(value);
173 stream->write(result.data(), result.size());
174}
175
176void PDFUtils::AppendTransform(const Matrix& matrix, const std::shared_ptr<WriteStream>& stream) {
177 auto affine = MatrixToPDFAffine(matrix);

Callers

nothing calls this directly

Calls 3

writeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected