Skip to content

Commit

Permalink
Merge pull request #270 from LeeMoonki/fix/android-build
Browse files Browse the repository at this point in the history
fix: build fail on Android, cast float to double - support React Native 0.72
  • Loading branch information
jpudysz committed Aug 28, 2024
2 parents 0929232 + 21301cf commit 8370345
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cxx/UnistylesImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ jsi::Value UnistylesRuntime::getNavigationBar(jsi::Runtime& rt, std::string fnNa
}

jsi::Value UnistylesRuntime::getPixelRatio(jsi::Runtime& rt, std::string fnName) {
return jsi::Value(roundf(this->pixelRatio * 100)/ 100);
return jsi::Value(static_cast<double>(roundf(this->pixelRatio * 100)/ 100));
}

jsi::Value UnistylesRuntime::getFontScale(jsi::Runtime& rt, std::string fnName) {
return jsi::Value(roundf(this->fontScale * 100) / 100);
return jsi::Value(static_cast<double>(roundf(this->fontScale * 100) / 100));
}

std::optional<jsi::Value> UnistylesRuntime::setThemes(jsi::Runtime& rt, const jsi::Value& value) {
Expand Down

0 comments on commit 8370345

Please sign in to comment.