Skip to content

Refactor sizing logic#70

Draft
SKProCH wants to merge 1 commit into
masterfrom
iconSizing
Draft

Refactor sizing logic#70
SKProCH wants to merge 1 commit into
masterfrom
iconSizing

Conversation

@SKProCH
Copy link
Copy Markdown
Owner

@SKProCH SKProCH commented Mar 30, 2026

After 3.0.0 i think that we actually need to change our sizing logic.

Two main goals:

This PR changes the measure logic (for now).

Main point: add Stretch and StretchDirection property to allow direct viewbox behavior customizing from user perspective.
Also, return explicit 24/24 size to Path in layout, since all icons (at least if i get it correctly, designed with 24px in mind. If there was an empty space - it should be kept as is)

Defaults:
Stretch - Uniform (preserves aspect ratio)
StretchDirection - DownOnly

I've setup a basic constraints (NEED TO DISCUSS, open to suggestions) (path == viewbox):

  • Width/Height drives the resulting control size. Padding shrinks actual path
  • IconSize defines resulting PATH size, padding will extend the control bounds over IconSize (Bounds == IconSize + Padding)
    this is done to keep sane FontSize behavior
  • If IconSize isn't set, use FontSize, (Bounds == FontSize + Padding)
    (cuz we sizing icon according to the FontSize, and user sets the Padding, i guess user wants padding be not shrink the icon)
    ^ NEEDS DISCUSSION
  • When using FontSize, and when MaterialIcon dont have enough space, then control should be shrink down (i guess)?
    ^ NEEDS DISCUSSION

@sn4k3

@SKProCH SKProCH added the bug Something isn't working label Mar 30, 2026
@SKProCH SKProCH marked this pull request as draft March 30, 2026 00:03
@SKProCH
Copy link
Copy Markdown
Owner Author

SKProCH commented Mar 30, 2026

Current sizing:

image

To implement:

  • IconSize doesn't work properly when we have less space then needed (i guess it shouldn't shrink) (row 6)
  • IconSize should setup the proper control bounds, now it just fills the entire space (or it shouldn't?)
  • Padding + IconSize don't sized as expected
  • Double check exact sizes from IconSize wrong sizing #66
  • Comparison with a 2.x.x implementation and sizing

@sn4k3
Copy link
Copy Markdown
Collaborator

sn4k3 commented Apr 13, 2026

This PR still have small fixes that should be merged

@SKProCH
Copy link
Copy Markdown
Owner Author

SKProCH commented Apr 13, 2026

What did you mean?

@sn4k3
Copy link
Copy Markdown
Collaborator

sn4k3 commented Apr 13, 2026

What did you mean?

image image

@SKProCH
Copy link
Copy Markdown
Owner Author

SKProCH commented Apr 13, 2026

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants