-
Notifications
You must be signed in to change notification settings - Fork 172
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
Ruler marker resize for non-stretching grid items #6696
Conversation
#15358 Bundle Size — 58.2MiB (~+0.01%).feb8279(current) vs d1d46c1 master#15351(baseline) Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
|
Current #15358 |
Baseline #15351 |
|
---|---|---|
Initial JS | 41.17MiB (~+0.01% ) |
41.17MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 18.24% |
18.11% |
Chunks | 20 |
20 |
Assets | 22 |
22 |
Modules | 4189 |
4189 |
Duplicate Modules | 213 |
213 |
Duplicate Code | 27.24% |
27.24% |
Packages | 477 |
477 |
Duplicate Packages | 70 |
70 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #15358 |
Baseline #15351 |
|
---|---|---|
JS | 58.19MiB (~+0.01% ) |
58.19MiB |
HTML | 9.4KiB (-0.21% ) |
9.42KiB |
Bundle analysis report Branch feat/ruler-resize-fixed Project dashboard
Generated by RelativeCI Documentation Report issue
const gap = gridMetadata.specialSizeMeasurements.gap | ||
gridElement.style.gap = gap == null ? 'initial' : `${gap}px` | ||
} else { | ||
const hasRowGap = gridMetadata.specialSizeMeasurements.rowGap != null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a fix tangential to this PR, the problem is that gap
itself might be null even if rowGap
and columnGap
are defined - the example is a configuration with uneven row/col gaps.
**Problem:** It should be possible to resize non-stretching grid items via the ruler markers. **Fix:** Because of how grids are rendered, similarly to what happened in #6691, we need to calculate the rendered dimensions of grid _cells_ (not their contained items!) after they are rendered, since for non-stretching grid items their dimensions (via `getGridChildCellCoordBoundsFromCanvas`) don't match the ones of the cell(s) they are configured to target. This PR uses the logic introduced in #6691 to calculate the size of a grid cell starting from its item, and uses that to correctly place the ruler markers for non-stretching items. **Manual Tests:** I hereby swear that: - [x] I opened a hydrogen project and it loaded - [x] I could navigate to various routes in Play mode Fixes #6695
Problem:
It should be possible to resize non-stretching grid items via the ruler markers.
Fix:
Because of how grids are rendered, similarly to what happened in #6691, we need to calculate the rendered dimensions of grid cells (not their contained items!) after they are rendered, since for non-stretching grid items their dimensions (via
getGridChildCellCoordBoundsFromCanvas
) don't match the ones of the cell(s) they are configured to target.This PR uses the logic introduced in #6691 to calculate the size of a grid cell starting from its item, and uses that to correctly place the ruler markers for non-stretching items.
Manual Tests:
I hereby swear that:
Fixes #6695