From c7f7ba250ce7d0d5eba9790d8319e4efa1e37657 Mon Sep 17 00:00:00 2001 From: vincentriemer Date: Mon, 27 Nov 2017 04:55:17 -0800 Subject: [PATCH] Add Config::setPointScaleFactor to JavaScript binding Summary: Needed for a project I'm working on to properly render on high dpi screens. I've manually tested against my project to confirm it works. Closes https://github.com/facebook/yoga/pull/612 Differential Revision: D6413517 Pulled By: emilsjolander fbshipit-source-id: c298d7f6b58dc45aaaede2bb995df8615911a4a9 --- javascript/sources/Config.cc | 5 +++++ javascript/sources/Config.hh | 1 + javascript/sources/nbind.cc | 1 + 3 files changed, 7 insertions(+) diff --git a/javascript/sources/Config.cc b/javascript/sources/Config.cc index ac0090a8..79a6b9c4 100644 --- a/javascript/sources/Config.cc +++ b/javascript/sources/Config.cc @@ -36,6 +36,11 @@ void Config::setExperimentalFeatureEnabled(int feature, bool enabled) YGConfigSetExperimentalFeatureEnabled(m_config, static_cast(feature), enabled); } +void Config::setPointScaleFactor(float pixelsInPoint) +{ + YGConfigSetPointScaleFactor(m_config, pixelsInPoint); +} + bool Config::isExperimentalFeatureEnabled(int feature) const { return YGConfigIsExperimentalFeatureEnabled(m_config, static_cast(feature)); diff --git a/javascript/sources/Config.hh b/javascript/sources/Config.hh index 055f4d94..5f4e1bfb 100644 --- a/javascript/sources/Config.hh +++ b/javascript/sources/Config.hh @@ -40,6 +40,7 @@ class Config { public: // Setters void setExperimentalFeatureEnabled(int feature, bool enabled); + void setPointScaleFactor(float pixelsInPoint); public: // Getters diff --git a/javascript/sources/nbind.cc b/javascript/sources/nbind.cc index acd28e1b..ce6c0b8f 100644 --- a/javascript/sources/nbind.cc +++ b/javascript/sources/nbind.cc @@ -47,6 +47,7 @@ NBIND_CLASS(Config) method(destroy); method(setExperimentalFeatureEnabled); + method(setPointScaleFactor); method(isExperimentalFeatureEnabled); }