Standardverschiebung für Shape#nextTo()

This commit is contained in:
ngb
2022-06-21 21:32:56 +02:00
parent 2b20cc0f8e
commit 7293f62a19

View File

@@ -71,6 +71,11 @@ public class Constants {
*/
public static final int STD_FONTSIZE = 14;
/**
* Standardwert für den Abstand von Formen.
*/
public static final int STD_BUFFER = 10;
public static final Options.StrokeType SOLID = Options.StrokeType.SOLID;
public static final Options.StrokeType DASHED = Options.StrokeType.DASHED;
@@ -759,6 +764,10 @@ public class Constants {
return from + t * (to - from);
}
public static final double morph( double from, double to, double t ) {
return interpolate(from, to, limit(t, 0.0, 1.0));
}
public static final double map( double value, double fromMin, double fromMax, double toMin, double toMax ) {
return interpolate(toMin, toMax, (value - fromMin) / (fromMax - fromMin));
}