MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / ellipsePath

Function ellipsePath

packages/core/ui/styling/background.ios.ts:1253–1267  ·  view source on GitHub ↗
(value: string, position: Position)

Source from the content-addressed store, hash-verified

1251}
1252
1253function ellipsePath(value: string, position: Position): UIBezierPath {
1254 const arr = value.split(/[\s]+/);
1255
1256 const rX = cssValueToDeviceIndependentPixels(arr[0], position.right);
1257 const rY = cssValueToDeviceIndependentPixels(arr[1], position.bottom);
1258 const cX = cssValueToDeviceIndependentPixels(arr[3], position.right);
1259 const cY = cssValueToDeviceIndependentPixels(arr[4], position.bottom);
1260
1261 const left = cX - rX;
1262 const top = cY - rY;
1263 const width = rX * 2;
1264 const height = rY * 2;
1265
1266 return UIBezierPath.bezierPathWithOvalInRect(CGRectMake(left, top, width, height)).CGPath;
1267}
1268
1269function polygonPath(value: string, position: Position): UIBezierPath {
1270 const path = CGPathCreateMutable();

Callers 1

generateClipPathFunction · 0.85

Calls 1

Tested by

no test coverage detected