mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 20:49:14 +08:00
Merge pull request #18516 from ant-design/fix-circle-button
fix: circle button is not circle
This commit is contained in:
commit
5b5b828cfd
@ -16,7 +16,7 @@ const eslintrc = {
|
|||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
react: {
|
react: {
|
||||||
version: '16.8',
|
version: '16.9',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
parser: '@typescript-eslint/parser',
|
parser: '@typescript-eslint/parser',
|
||||||
|
@ -518,6 +518,14 @@ exports[`renders ./components/button/demo/icon.md correctly 1`] = `
|
|||||||
</svg>
|
</svg>
|
||||||
</i>
|
</i>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
class="ant-btn ant-btn-primary ant-btn-circle"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
A
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
class="ant-btn ant-btn-primary"
|
class="ant-btn ant-btn-primary"
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -23,6 +23,9 @@ import { Button } from 'antd';
|
|||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<div>
|
<div>
|
||||||
<Button type="primary" shape="circle" icon="search" />
|
<Button type="primary" shape="circle" icon="search" />
|
||||||
|
<Button type="primary" shape="circle">
|
||||||
|
A
|
||||||
|
</Button>
|
||||||
<Button type="primary" icon="search">
|
<Button type="primary" icon="search">
|
||||||
Search
|
Search
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -252,9 +252,17 @@
|
|||||||
}
|
}
|
||||||
// circle button: the content only contains icon
|
// circle button: the content only contains icon
|
||||||
.btn-circle(@btnClassName: btn) {
|
.btn-circle(@btnClassName: btn) {
|
||||||
|
min-width: @btn-height-base;
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
text-align: center;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
&.@{btnClassName}-lg,
|
&.@{btnClassName}-lg {
|
||||||
|
min-width: @btn-height-lg;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
&.@{btnClassName}-sm {
|
&.@{btnClassName}-sm {
|
||||||
|
min-width: @btn-height-sm;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ class PicSearcher extends Component<PicSearcherProps, PicSearcherState> {
|
|||||||
const img = new Image();
|
const img = new Image();
|
||||||
img.setAttribute('crossOrigin', 'anonymous');
|
img.setAttribute('crossOrigin', 'anonymous');
|
||||||
img.src = url;
|
img.src = url;
|
||||||
img.onload = function() {
|
img.onload = function onload() {
|
||||||
const scale = Math.min(1, 300 / Math.max(img.width, img.height));
|
const scale = Math.min(1, 300 / Math.max(img.width, img.height));
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
canvas.width = img.width * scale;
|
canvas.width = img.width * scale;
|
||||||
|
Loading…
Reference in New Issue
Block a user