Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ void packBoxShadow(folly::dynamic& dyn, const AnimatedPropBase& animatedProp) {
void packMixBlendMode(
folly::dynamic& dyn,
const AnimatedPropBase& animatedProp) {
const auto& blendMode = get<BlendMode>(animatedProp);
const auto& mixBlendMode = get<BlendMode>(animatedProp);
std::string blendModeStr;
switch (blendMode) {
switch (mixBlendMode) {
case BlendMode::Normal:
blendModeStr = "normal";
break;
Expand Down Expand Up @@ -519,6 +519,25 @@ void packMixBlendMode(
dyn.insert("mixBlendMode", blendModeStr);
}

void packBackfaceVisibility(
folly::dynamic& dyn,
const AnimatedPropBase& animatedProp) {
const auto& backfaceVisibility = get<BackfaceVisibility>(animatedProp);
std::string visibilityStr;
switch (backfaceVisibility) {
case BackfaceVisibility::Auto:
visibilityStr = "auto";
break;
case BackfaceVisibility::Visible:
visibilityStr = "visible";
break;
case BackfaceVisibility::Hidden:
visibilityStr = "hidden";
break;
}
dyn.insert("backfaceVisibility", visibilityStr);
}

void packAnimatedProp(
folly::dynamic& dyn,
const std::unique_ptr<AnimatedPropBase>& animatedProp) {
Expand Down Expand Up @@ -607,6 +626,10 @@ void packAnimatedProp(
packMixBlendMode(dyn, *animatedProp);
break;

case BACKFACE_VISIBILITY:
packBackfaceVisibility(dyn, *animatedProp);
break;

case WIDTH:
case HEIGHT:
case FLEX:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ enum PropName {
ISOLATION,
CURSOR,
BOX_SHADOW,
MIX_BLEND_MODE
MIX_BLEND_MODE,
BACKFACE_VISIBILITY
};

struct AnimatedPropBase {
Expand Down Expand Up @@ -410,6 +411,10 @@ inline void cloneProp(BaseViewProps &viewProps, const AnimatedPropBase &animated
viewProps.mixBlendMode = get<BlendMode>(animatedProp);
break;

case BACKFACE_VISIBILITY:
viewProps.backfaceVisibility = get<BackfaceVisibility>(animatedProp);
break;

default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ struct AnimatedPropsBuilder {
{
props.push_back(std::make_unique<AnimatedProp<CascadedRectangleEdges<yoga::StyleLength>>>(POSITION, value));
}
void setFlex(yoga::FloatOptional value)
{
props.push_back(std::make_unique<AnimatedProp<yoga::FloatOptional>>(FLEX, value));
}
void setTransform(Transform &t)
{
props.push_back(std::make_unique<AnimatedProp<Transform>>(TRANSFORM, std::move(t)));
Expand Down Expand Up @@ -212,6 +216,10 @@ struct AnimatedPropsBuilder {
{
props.push_back(std::make_unique<AnimatedProp<BlendMode>>(MIX_BLEND_MODE, value));
}
void setBackfaceVisibility(BackfaceVisibility value)
{
props.push_back(std::make_unique<AnimatedProp<BackfaceVisibility>>(BACKFACE_VISIBILITY, value));
}
void storeDynamic(folly::dynamic &d)
{
rawProps = std::make_unique<RawProps>(std::move(d));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ inline void updateProp(const PropName propName, BaseViewProps &viewProps, const
case MIX_BLEND_MODE:
viewProps.mixBlendMode = snapshot.props.mixBlendMode;
break;

case BACKFACE_VISIBILITY:
viewProps.backfaceVisibility = snapshot.props.backfaceVisibility;
break;
}
}

Expand Down
Loading