Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OutlineInputBorder adjusts for borderRadius that is too large #34515

Merged
merged 11 commits into from Jun 24, 2019

Conversation

@shihaohong
Copy link
Contributor

commented Jun 14, 2019

Description

Before, when OutlineInputBorder is fed border radii that are too large, it starts to draw the borders incorrectly when it is selected. This fix calculates the radii in terms of ratios based on the allowed height, maintaining the same shape before the field is selected.

Example:

TextField(
  decoration: InputDecoration(
    border: OutlineInputBorder(
      // borderRadius: BorderRadius.all(Radius.circular(5.0)),
      borderRadius: BorderRadius.only(
        topLeft: Radius.circular(100.0),
        bottomLeft: Radius.circular(200.0),
        topRight: Radius.circular(300.0),
        bottomRight: Radius.circular(400.0),
      ),
    ),
    labelText: 'PasswordPasswordPasswordPasswordPasswordPasswordPasswordPasswordPasswordPassword',
  ),
),

Before:
old-border

After:
new-border

Related Issues

Fixes #34327

Tests

I added the following tests:

  • A test to verify that OutlineInputBorder paints on points along the desired border path.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.
shihaohong added 2 commits Jun 18, 2019
@shihaohong shihaohong changed the title WIP - OutlineInputBorder adjusts for borderRadius that is too large OutlineInputBorder adjusts for borderRadius that is too large Jun 18, 2019
shihaohong added 2 commits Jun 24, 2019
Copy link
Contributor

left a comment

LGTM

@shihaohong shihaohong merged commit ea4460d into flutter:master Jun 24, 2019
55 checks passed
55 checks passed
WIP Ready for review
Details
add2app-macos Task Summary
Details
add2app-macos
Details
analyze Task Summary
Details
analyze
Details
build_tests-linux Task Summary
Details
build_tests-linux
Details
build_tests-macos Task Summary
Details
build_tests-macos
Details
build_tests-windows Task Summary
Details
build_tests-windows
Details
cla/google All necessary CLAs are signed
deploy_gallery Task Summary
Details
deploy_gallery
Details
deploy_gallery-macos Task Summary
Details
deploy_gallery-macos
Details
docs Task Summary
Details
docs
Details
flutter-build
Details
integration_tests-linux Task Summary
Details
integration_tests-linux
Details
integration_tests-windows Task Summary
Details
integration_tests-windows
Details
integration_tests_gradle1-linux Task Summary
Details
integration_tests_gradle1-linux
Details
integration_tests_gradle2-linux Task Summary
Details
integration_tests_gradle2-linux
Details
release_smoke_tests Task Summary
Details
release_smoke_tests
Details
tests_extras-linux Task Summary
Details
tests_extras-linux
Details
tests_extras-macos Task Summary
Details
tests_extras-macos
Details
tests_extras-windows Task Summary
Details
tests_extras-windows
Details
tests_framework_other-linux Task Summary
Details
tests_framework_other-linux
Details
tests_framework_other-macos Task Summary
Details
tests_framework_other-macos
Details
tests_framework_other-windows Task Summary
Details
tests_framework_other-windows
Details
tests_widgets-linux Task Summary
Details
tests_widgets-linux
Details
tests_widgets-macos Task Summary
Details
tests_widgets-macos
Details
tests_widgets-windows Task Summary
Details
tests_widgets-windows
Details
tool_tests-linux Task Summary
Details
tool_tests-linux
Details
tool_tests-macos Task Summary
Details
tool_tests-macos
Details
tool_tests-windows Task Summary
Details
tool_tests-windows
Details
web_tests-linux Task Summary
Details
web_tests-linux
Details
@shihaohong shihaohong deleted the shihaohong:outline-input-border branch Jun 24, 2019
goderbauer added a commit to goderbauer/flutter that referenced this pull request Jul 3, 2019
…r#34515)

* Implement OutlineInputBorder BorderRadius scaling via RRect.scaleRadii

* Add regression test to test for border scaling
johnsonmh added a commit to johnsonmh/flutter that referenced this pull request Jul 30, 2019
…r#34515)

* Implement OutlineInputBorder BorderRadius scaling via RRect.scaleRadii

* Add regression test to test for border scaling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.