Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -911,7 +911,9 @@ private void updatePath() {
}

mInnerBottomLeftCorner.x = mInnerClipTempRectForBorderRadius.left;
mInnerBottomLeftCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
mInnerBottomLeftCorner.y = borderWidth.bottom != 0
? mInnerClipTempRectForBorderRadius.bottom * -2
: mInnerClipTempRectForBorderRadius.bottom;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand DownExpand Up@@ -963,7 +965,9 @@ private void updatePath() {
}

mInnerBottomRightCorner.x = mInnerClipTempRectForBorderRadius.right;
mInnerBottomRightCorner.y = mInnerClipTempRectForBorderRadius.bottom * -2;
mInnerBottomRightCorner.y = borderWidth.bottom != 0

@javachejavacheFeb 15, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why don't need this logic for mInnerTopLeftCorner and mInnerTopRightCorner?

@BeeMargaridaBeeMargaridaFeb 15, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can be added (my bad, I kinda had tunnel vision). In the cases where this bug happened it won't cause any difference though, because mInnerClipTempRectForBorderRadius.top was always 0. Do you want me to make a commit adding the same logic to mInnerTopLeftCorner and mInnerTopRightCorner?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't make a difference, we shouldn't add it. So you're saying we don't need similar logic for the top corners?

@BeeMargaridaBeeMargaridaFeb 15, 2023

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not totally sure. From what I saw from the code, mInnerClipTempRectForBorderRadius is set based on the getBounds of the drawable. In cases where the bounds don't change, top will always be 0. Is there any possibility of the bounds changing in this case?

Update: ah, there is if we change the size of drawable...I'll test it (nvm, not the case, from what I can tell top will always remain 0)

? mInnerClipTempRectForBorderRadius.bottom * -2
: mInnerClipTempRectForBorderRadius.bottom;

getEllipseIntersectionWithLine(
// Ellipse Bounds
Expand Down
38 changes: 37 additions & 1 deletion packages/rn-tester/js/examples/View/ViewExample.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -431,7 +431,7 @@ exports.examples = [
title: 'Rounded Borders',
render(): React.Node {
return (
<View style={{flexDirection: 'row'}}>
<View style={{flexDirection: 'row', flexWrap: 'wrap'}}>
<View
style={{
width: 50,
Expand DownExpand Up@@ -474,6 +474,42 @@ exports.examples = [
marginRight: 10,
}}
/>
<View
style={{
width: 50,
height: 50,
borderLeftWidth: 6,
borderTopWidth: 6,
borderTopLeftRadius: 20,
}}
/>
<View
style={{
width: 50,
height: 50,
borderRightWidth: 6,
borderTopWidth: 6,
borderTopRightRadius: 20,
}}
/>
<View
style={{
width: 50,
height: 50,
borderBottomWidth: 6,
borderLeftWidth: 6,
borderBottomLeftRadius: 20,
}}
/>
<View
style={{
width: 50,
height: 50,
borderBottomWidth: 6,
borderRightWidth: 6,
borderBottomRightRadius: 20,
}}
/>
</View>
);
},
Expand Down