lockAspectRatio still breaks at independent min/max constraints
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 76/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Start at the lockAspectRatio constraint projection and clamping logic in the current implementation, then run the focused regression test described in the issue. Verify width and height minimum and maximum bounds, overshoot/return, and a subsequent gesture preserve the aspect ratio when possible. Confirm the incompatible-bounds control still gives size constraints precedence.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
With lockAspectRatio enabled, independently calculated width and height constraints can still change the aspect ratio on current master (c6fd4ab8d3d4e9c0707c2bbb6d47d0fcbdb5e6b9, 4.0.2).
For example, start at 300 × 150 (2:1), set minConstraints={[100, 50]} and maxConstraints={[420, 400]}, then drag the southeast handle toward 600 × 300. The current result is 420 × 300 rather than 420 × 210. The width and height are clamped independently after projection onto the ratio line. With a controlled component, that changed ratio also becomes the next resize's input ratio.
Expected: when a size satisfying both bounds and the ratio exists, keep the ratio and choose that size. If the bounds make the ratio impossible, retain size-constraint precedence rather than exceeding a bound.
Related historical report: #51. The current implementation still reproduces this despite the later projection rewrite. I have a focused regression test covering width/height minimum and maximum bounds, overshoot/return and a subsequent gesture. Five new tests fail on unchanged master; the incompatible-bounds control passes.
- Lingua principale
- TypeScript
- Stelle
- 2.6k
- Fork
- 373
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react-grid-layout/react-resizable
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
react-grid-layout/react-resizable#237 · 8 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
react-grid-layout/react-resizable#222 · 4 commenti ·
Tutte le issue di react-grid-layout/react-resizable
Issue simili
-
submodule-pointer-regression
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
smith-horn/skillsmith#3061 ·
I maintainer di solito rispondono entro 1 giorno
-
area: ops type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
accensa/x402-facilitator-stellar#559 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
cosimochellini/one-piece-zero-spoiler#551 ·
I maintainer di solito rispondono entro 1 giorno
-
getWatched() omits __proto__ directories when cwd is setForse già presa @maxazure l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
-
area:web enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno