java.lang.Object
com.github.weisj.jsvg.geometry.size.Length
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Length
@NotNull Length
coercePercentageToCorrectUnit
(@NotNull UnitType unitType) boolean
int
hashCode()
boolean
static boolean
isSpecified
(float value) boolean
static boolean
isUnspecified
(float value) boolean
isZero()
multiply
(float scalingFactor) orElseIfUnspecified
(float value) float
raw()
float
resolveFontSize
(@NotNull MeasureContext context) Used for resolving font sizes.float
resolveHeight
(@NotNull MeasureContext context) Used for resolving lengths which are used as y-coordinates or height values.float
resolveLength
(@NotNull MeasureContext context) Used for resolving lengths which are neither used as y/x-coordinates nor width/height values.private float
resolveNonPercentage
(@NotNull MeasureContext context) float
resolveWidth
(@NotNull MeasureContext context) Used for resolving lengths which are used as x-coordinates or width values.toString()
@NotNull Unit
unit()
-
Field Details
-
UNSPECIFIED_RAW
public static final float UNSPECIFIED_RAW- See Also:
-
UNSPECIFIED
-
ZERO
-
unit
-
value
private final float value -
pixelsPerInch
private static final float pixelsPerInch- See Also:
-
inchesPerCm
private static final float inchesPerCm- See Also:
-
-
Constructor Details
-
Length
-
-
Method Details
-
isUnspecified
public static boolean isUnspecified(float value) -
isSpecified
public static boolean isSpecified(float value) -
resolveNonPercentage
-
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()
-