2016-10-27 10:52:09 -07:00
|
|
|
/**
|
2016-09-22 16:22:34 -07:00
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Facebook.CSSLayout
|
|
|
|
{
|
|
|
|
public class MeasureOutput
|
|
|
|
{
|
2016-11-10 19:13:19 -08:00
|
|
|
public static long Make(double width, double height)
|
|
|
|
{
|
|
|
|
return Make((int) width, (int) height);
|
|
|
|
}
|
|
|
|
|
2016-10-27 10:52:09 -07:00
|
|
|
public static long Make(int width, int height)
|
|
|
|
{
|
2016-11-10 19:13:19 -08:00
|
|
|
return (long)(((ulong) width) << 32 | ((ulong) height));
|
2016-10-27 10:52:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int GetWidth(long measureOutput)
|
|
|
|
{
|
2016-11-10 19:13:19 -08:00
|
|
|
return (int) (0xFFFFFFFF & (measureOutput >> 32));
|
2016-10-27 10:52:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int GetHeight(long measureOutput)
|
|
|
|
{
|
2016-11-10 19:13:19 -08:00
|
|
|
return (int) (0xFFFFFFFF & measureOutput);
|
2016-10-27 10:52:09 -07:00
|
|
|
}
|
2016-09-22 16:22:34 -07:00
|
|
|
}
|
|
|
|
}
|