Logo
Explore Help
Sign In
DaddyFrosty/yoga
1
0
Fork 0
You've already forked yoga
Code Issues 96 Pull Requests 31 Actions Packages Projects Releases 33 Wiki Activity
Files
7df60376ff6a6c2681fa307c985a9905d2c010d8
yoga/javascript/sources/Value.hh

32 lines
467 B
C++
Raw Normal View History

Improve JS bindings Summary: - Fix a few things related to how npm should publish the package (sources were in the gitignore file, so I think it would have break the build during install - I fixed this by adding a npmignore that should override the gitignore rules) - The enumerations values are now generated directly from `enums.py` - I added percent unit support (#258) to the bindings (`.setWidthPercent` is currently exposed, but I've also added a very very little parsing to also support `.setWidth("100%")` and `.setWidth(.getWidth())`), added the missing tests, and fixed Travis. Closes https://github.com/facebook/yoga/pull/314 Reviewed By: mikearmstrong001 Differential Revision: D4377198 Pulled By: emilsjolander fbshipit-source-id: 774dfafd416f5421f3be59a1d181eb7056487abe
2017-01-04 04:33:39 -08:00
#pragma once
#include <yoga/Yoga.h>
struct Value
{
static Value fromYGValue(YGValue const & ygValue)
{
return Value(static_cast<int>(ygValue.unit), ygValue.value);
}
int unit;
double value;
Value(void)
: unit(YGUnitUndefined)
, value(0.0)
{
}
Value(int unit, double value)
: unit(unit)
, value(value)
{
}
void toJS(nbind::cbOutput expose) const
{
expose(unit, value);
}
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.3 Page: 89ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API