ios cornder radius is rendered as circle now (#3915)

* ios cornder radius is rendered as circle now

* fix failing test
This commit is contained in:
Hristo Hristov
2017-03-31 16:18:12 +03:00
committed by GitHub
parent e802206f0e
commit 120230c297
2 changed files with 4 additions and 1 deletions

View File

@@ -37,7 +37,9 @@ export module ios {
const borderColor = background.getUniformBorderColor();
layer.borderColor = !borderColor ? undefined : borderColor.ios.CGColor;
layer.borderWidth = layout.toDeviceIndependentPixels(background.getUniformBorderWidth());
layer.cornerRadius = layout.toDeviceIndependentPixels(background.getUniformBorderRadius());
const renderSize = view.getActualSize() || { width: 0, height: 0 };
const cornerRadius = layout.toDeviceIndependentPixels(background.getUniformBorderRadius());
layer.cornerRadius = Math.min(Math.min(renderSize.width / 2, renderSize.height / 2), cornerRadius);
}
else {
drawNonUniformBorders(nativeView, background);