From 705845e5d359200fdf00ae272fc14217fe97d9b2 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Mon, 14 Mar 2022 22:45:48 +0100
Subject: [PATCH] Comment units functions
---
src/utils/units.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/utils/units.cpp b/src/utils/units.cpp
index 2c7a1237..deb4aa7c 100644
--- a/src/utils/units.cpp
+++ b/src/utils/units.cpp
@@ -45,6 +45,9 @@ namespace units_utils {
return static_cast(math_util::percentage_to_value(g_format.percentage, max) + offset_pixel);
}
+ /**
+ * Same as percentage_with_offset_to_pixel but capped below at 0 pixels
+ */
unsigned percentage_with_offset_to_pixel_nonnegative(percentage_with_offset g_format, double max, double dpi) {
return std::max(0, percentage_with_offset_to_pixel(g_format, max, dpi));
}
@@ -135,6 +138,11 @@ namespace units_utils {
return {type, size_value};
}
+ /**
+ * Creates an extent from a spacing value.
+ *
+ * @param spacing Value to convert, must not be SPACE
+ */
extent_val spacing_to_extent(spacing_val spacing) {
extent_type t;