2007. 4. 19. 00:17
Code/Java
constrain
ref. http://dev.processing.org/reference/everything/
View of /trunk/processing/core/src/processing/core/PApplet.java
constrain(float, float, float) - Static method in class processing.core.
public static final float constrain(float amt, float low, float high)
constrain(int, int, int) - Static method in class processing.core.
public static final int constrain(int amt, int low, int high)
ref. http://dev.processing.org/reference/everything/
View of /trunk/processing/core/src/processing/core/PApplet.java
constrain(float, float, float) - Static method in class processing.core.
public static final float constrain(float amt, float low, float high)
static public final float constrain(float amt, float low, float high) {
return (amt < low) ? low : ((amt > high) ? high : amt);
}
return (amt < low) ? low : ((amt > high) ? high : amt);
}
constrain(int, int, int) - Static method in class processing.core.
public static final int constrain(int amt, int low, int high)
static public final int constrain(int amt, int low, int high) {
return (amt < low) ? low : ((amt > high) ? high : amt);
}
return (amt < low) ? low : ((amt > high) ? high : amt);
}