Skip to content

Border.symmetric seems wrong. Horizontal = top/bottom? #122034

Closed

Description

@bernaferrari

I really don't understand this. Shouldn't vertical = top/bottom and horizontal = left/right? Why is the opposite?

image

Source:
https://github.com/flutter/flutter/blob/f5ddece56e0e9d21d3b3f2d46d96330cb7bd789b/packages/flutter/lib/src/painting/box_border.dart#LL340C5-L340C5

Could anyone help me understand if this is intended and why?
EdgeInsets work fine, every other symmetrical Flutter usage seems fine, but Border.symmetric doesn't make sense to me.
This was implemented/updated by @tvolkert about 3 years ago.

Activity

  1. changed the title [-]Border.symmetric seems wrong. Horizontal = top/bottom?[/-] [+]`Border.symmetric` seems wrong. Horizontal = top/bottom?[/+] on Mar 6, 2023
  2. tvolkert commented on Mar 6, 2023

    @tvolkert
    Contributor

    Yep, this is intended (and was changed in #61470)

    It's because the lines on the top and bottom are horizontal lines -- and the lines on the left and right are vertical lines.

    Per https://en.wikipedia.org/wiki/Vertical_and_horizontal:

    a direction or plane passing by a given point is said to be vertical if it contains the local gravity direction at that point. Conversely, a direction or plane is said to be horizontal (or leveled) if it is perpendicular to the vertical direction.

  3. bernaferrari commented on Mar 6, 2023

    @bernaferrari
    ContributorAuthor

    wow, it was hard for me to understand. I guess it makes some sense! Thanks, lol

    I saw the original issue but never saw the reason, so I couldn't sleep thinking about this. Thanks!

  4. github-actions commented on Mar 20, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions