initial commit

This commit is contained in:
2025-10-09 14:37:45 +03:00
commit fe3b5899ab
22 changed files with 657 additions and 0 deletions

23
source/Utils.mc Normal file
View File

@ -0,0 +1,23 @@
import Toybox.Lang;
import Toybox.Graphics;
// no types here, because this is generic, which are not supported by language
function getOrElse(value, defaultValue) {
if (value == null) {
return defaultValue;
} else {
return value;
}
}
function min(left as Numeric, right as Numeric) as Numeric {
if (left < right) {
return left;
} else {
return right;
}
}
function getCenter(dc as Dc, shift as [Float, Float]) as [Float, Float] {
return [dc.getWidth() / 2.0 + shift[0], dc.getHeight() / 2.0 + shift[1]];
}