Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ios fabric transform origin #38559

Closed
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
@@ -0,0 +1,24 @@
#pragma once

namespace facebook::react {

enum class UnitType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To represent initial/undefined value? Also useful to check the value is set. Check isSet in TransformOrigin struct.

Undefined,
Point,
Percent,
};

struct ValueUnit {
float value{0.0f};
UnitType unit{UnitType::Undefined};

ValueUnit(float v, UnitType u) : value(v), unit(u) {}

bool operator==(const ValueUnit& other) const {
return value == other.value && unit == other.unit;
}
bool operator!=(const ValueUnit& other) const {
return !(*this == other);
}
};
}