react / react/react-native

[Android] Incorrect border coloration with sufficiently high border radius

Đang mở
#41,707 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Issue: Author Provided Repro Needs: Triage :mag: Platform: Android
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

It seems Android has trouble displaying the correct border colors when borderRadius exceeds a certain value.

The use case here is having an easily reusable style or component which can be circular regardless of the size; most easily achieved by setting a high border radius. Given that this works as intended on iOS and web, I assume it is a supported use case. If border radius is not intended to exceed a certain calculable value it should be noted in the docs somewhere but I was unable to find any relevant information. Alternatively, It might make sense to clamp the value in the RN core code but I'll leave that to the maintainers to decide.

Based on my testing this issue only impacts Android as you can see in the screenshots from the snack I've linked below.
Web:
Screenshot 2023-11-29 at 9 02 21 AM
iOS:
Screenshot 2023-11-29 at 9 02 06 AM
Android:
Screenshot 2023-11-29 at 8 59 58 AM

I've seen some other recent issues around border radius on Android but none of them seem to be directly related to this particular behavior based on my understanding so apologies if this is a duplicate, obviously feel free to close/merge in that case.

React Native Version

0.72.7

Output of npx react-native info

System:
OS: macOS 13.6
CPU: (10) arm64 Apple M1 Max
Memory: 2.82 GB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.16.0
path: ~/.nvm/versions/node/v18.16.0/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v18.16.0/bin/yarn
npm:
version: 9.5.1
path: ~/.nvm/versions/node/v18.16.0/bin/npm
Watchman:
version: 2023.10.23.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.2
path: /opt/homebrew/opt/ruby/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.0
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9971841
Xcode:
version: 15.0.1/15A507
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.2
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.7
wanted: 0.72.7
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Steps to reproduce
  1. Create a <View />.
  2. Give the view different colors for each of borderTopColor, borderBottomColor, borderRightColor, and borderLeftColor
  3. Set the view's height and width to any number, n
  4. Set the view's borderRadius to any number greater than n/2
  5. Observe the coloration of the border. Optionally, you can change the borderRadius value to see how the colors change with different values.
Snack, screenshot, or link to a repository

https://snack.expo.dev/gl3ZjJQi1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách chạy Snack được liên kết và tái hiện hành vi trên Android với các màu viền khác nhau và một borderRadius lớn hơn một nửa kích thước view. Truy vết điểm vào của border-rendering của React Native trên Android, sau đó đối chiếu kết quả với các ảnh chụp màn hình của iOS và web; được coi là hoàn tất khi màu viền trên Android vẫn chính xác đối với trường hợp bán kính được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, react-native
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.