Class Length
java.lang.Object
com.github.weisj.jsvg.geometry.size.Length
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Length@NotNull LengthcoercePercentageToCorrectUnit(@NotNull UnitType unitType) booleaninthashCode()booleanstatic booleanisSpecified(float value) booleanstatic booleanisUnspecified(float value) booleanisZero()multiply(float scalingFactor) orElseIfUnspecified(float value) floatraw()floatresolveFontSize(@NotNull MeasureContext context) Used for resolving font sizes.floatresolveHeight(@NotNull MeasureContext context) Used for resolving lengths which are used as y-coordinates or height values.floatresolveLength(@NotNull MeasureContext context) Used for resolving lengths which are neither used as y/x-coordinates nor width/height values.floatresolveWidth(@NotNull MeasureContext context) Used for resolving lengths which are used as x-coordinates or width values.toString()@NotNull Unitunit()
-
Field Details
-
UNSPECIFIED_RAW
public static final float UNSPECIFIED_RAW- See Also:
-
UNSPECIFIED
-
ZERO
-
-
Constructor Details
-
Length
-
-
Method Details
-
isUnspecified
public static boolean isUnspecified(float value) -
isSpecified
public static boolean isSpecified(float value) -
resolveWidth
Used for resolving lengths which are used as x-coordinates or width values.- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
resolveHeight
Used for resolving lengths which are used as y-coordinates or height values.- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
resolveLength
Used for resolving lengths which are neither used as y/x-coordinates nor width/height values. Relative sizes are relative to theViewBox.normedDiagonalLength().- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
resolveFontSize
Used for resolving font sizes. Relative values will be resolves with respect to the current font size. This isn't dependent on the current viewBox.- Parameters:
context- the measuring context.- Returns:
- the resolved size.
-
toString
-
isZero
public boolean isZero() -
raw
public float raw() -
unit
-
isUnspecified
public boolean isUnspecified() -
isSpecified
public boolean isSpecified() -
coerceNonNegative
-
coercePercentageToCorrectUnit
-
orElseIfUnspecified
-
multiply
-
equals
-
hashCode
public int hashCode()
-