Skip to content

[Idea] Make center/outside stroke more consistent. #106362

@bernaferrari

Description

@bernaferrari

Note
This is specific to RoundedRectangleBorder. BoxBorder already does this via isUniform.

A few weeks ago I opened this issue (#104201) because I thought it felt better. However, today I was playing with Figma and, not that Flutter has to follow it, Figma has the same StrokeAlign.start as Flutter, which is great. My issue then is closed.

... Except...

When I made the PR for StrokeAlign.center and outside, I made the rectangle rounder (check screenshot) because it is impossible to lerp from 0-1 otherwise. Figma doesn't do this. So... should we have the same behavior of StrokeAlign.start for center and outside, which is the same as Figma, but doesn't lerp 0-1 perfectly (check video)? It is a two or three LOC change and it hasn't landed on stable yet, so it is not a breaking change.

Pro: consistency, same behavior as start, same behavior as Figma.
Cons: lerp from 0.0 to 1.0 will jump.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions