lottie: Revise the solid model

To ensure consistent properties, `LottieSolid` has been defined.

Both `LottieSolidStroke` and `LottieSolidFill` can be typecasted to the `LottieSolid`.
This commit is contained in:
Jinny You 2024-02-21 00:46:54 +09:00 committed by Hermet Park
parent e333ca9515
commit 447a3d8ad5

View file

@ -323,20 +323,24 @@ struct LottieTransform : LottieObject
}; };
struct LottieSolidStroke : LottieObject, LottieStroke struct LottieSolid : LottieObject
{
LottieColor color = RGB24{255, 255, 255};
LottieOpacity opacity = 255;
};
struct LottieSolidStroke : LottieSolid, LottieStroke
{ {
void prepare() void prepare()
{ {
LottieObject::type = LottieObject::SolidStroke; LottieObject::type = LottieObject::SolidStroke;
if (color.frames || opacity.frames || LottieStroke::dynamic()) statical = false; if (color.frames || opacity.frames || LottieStroke::dynamic()) statical = false;
} }
LottieColor color = RGB24{255, 255, 255};
LottieOpacity opacity = 255;
}; };
struct LottieSolidFill : LottieObject struct LottieSolidFill : LottieSolid
{ {
void prepare() void prepare()
{ {
@ -344,8 +348,6 @@ struct LottieSolidFill : LottieObject
if (color.frames || opacity.frames) statical = false; if (color.frames || opacity.frames) statical = false;
} }
LottieColor color = RGB24{255, 255, 255};
LottieOpacity opacity = 255;
FillRule rule = FillRule::Winding; FillRule rule = FillRule::Winding;
}; };