Skip to content

Commit

Permalink
fix(crop): [crop]modify crops component demo problem (#2419)
Browse files Browse the repository at this point in the history
* fix(crops): [crops]modify crops component

* fix(crops): [crops]modify crops e2e-test
  • Loading branch information
James-9696 authored Oct 28, 2024
1 parent bbd3be7 commit 98a1364
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
:cropvisible="visible"
@update:cropvisible="visible = $event"
:src="imgUrl"
:min-crop-box-width="100"
:min-crop-box-height="100"
:min-container-height="200"
:min-container-width="800"
:min-crop-box-width="200"
:min-crop-box-height="350"
:min-container-height="300"
:min-container-width="650"
></tiny-crop>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ test('裁剪框最小宽高', async ({ page }) => {

box = await face.boundingBox()

expect(box.width).toBe(100)
expect(box.height).toBe(56.25) // 此处有bug, 高度最小应该为 100, 实际最小为56.25
expect(box.width).toBe(199.99996948242188)
expect(box.height).toBe(112.5) // 此处有bug, 高度最小应该为 100, 实际最小为56.25

// 判断container 大小为 800*200
box = await container.boundingBox()

expect(box.width).toBe(800)
expect(box.height).toBe(200)
expect(box.width).toBe(650)
expect(box.height).toBe(300)
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
:cropvisible="visible"
@update:cropvisible="visible = $event"
:src="imgUrl"
:min-crop-box-width="100"
:min-crop-box-height="100"
:min-container-height="200"
:min-container-width="800"
:min-crop-box-width="200"
:min-crop-box-height="350"
:min-container-height="300"
:min-container-width="650"
></tiny-crop>
</div>
</template>
Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/crop/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@
margin-right: 8px;
padding: 4px;
cursor: pointer;
border-radius: 4px;

&:hover {
background: #f5f5f5;
Expand Down

0 comments on commit 98a1364

Please sign in to comment.