blob: 060dc07ab7b21d5d606a19357d6069ec53b14b82 [file] [log] [blame]
package com.airbnb.lottie;
import org.json.JSONObject;
class RectangleShape {
private static final String TAG = RectangleShape.class.getSimpleName();
private final IAnimatablePathValue position;
private final AnimatablePointValue size;
private final AnimatableFloatValue cornerRadius;
RectangleShape(JSONObject json, LottieComposition composition) {
position = AnimatablePathValue.createAnimatablePathOrSplitDimensionPath(
json.optJSONObject("p"), composition);
cornerRadius = new AnimatableFloatValue(json.optJSONObject("r"), composition);
size = new AnimatablePointValue(json.optJSONObject("s"), composition);
}
AnimatableFloatValue getCornerRadius() {
return cornerRadius;
}
AnimatablePointValue getSize() {
return size;
}
IAnimatablePathValue getPosition() {
return position;
}
@Override public String toString() {
return "RectangleShape{" + "cornerRadius=" + cornerRadius.getInitialValue() +
", position=" + position +
", size=" + size +
'}';
}
}