mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 06:03:38 +08:00
feat: change object-fit of UploadList to contain (#27312)
This commit is contained in:
parent
6e0981d1df
commit
75d4fdb3f1
@ -364,9 +364,9 @@ describe('Upload List', () => {
|
||||
// Offset check
|
||||
const [, offsetX, offsetY] = onDrawImage.mock.calls[0];
|
||||
if (width > height) {
|
||||
expect(offsetX < 0).toBeTruthy();
|
||||
expect(offsetX === 0).toBeTruthy();
|
||||
} else {
|
||||
expect(offsetY < 0).toBeTruthy();
|
||||
expect(offsetY === 0).toBeTruthy();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -475,7 +475,7 @@
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.@{upload-item}-name {
|
||||
|
@ -90,7 +90,7 @@ export function previewImage(file: File | Blob): Promise<string> {
|
||||
let offsetX = 0;
|
||||
let offsetY = 0;
|
||||
|
||||
if (width < height) {
|
||||
if (width > height) {
|
||||
drawHeight = height * (MEASURE_SIZE / width);
|
||||
offsetY = -(drawHeight - drawWidth) / 2;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user