-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(g-svg): should not handle fontSize < 12 for text, close antvis#465
- Loading branch information
1 parent
65eb610
commit 3f2da8b
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const expect = require('chai').expect; | ||
import Canvas from '../../../g-svg/src/canvas'; | ||
|
||
const dom = document.createElement('div'); | ||
document.body.appendChild(dom); | ||
dom.id = 'c1'; | ||
|
||
describe('#465', () => { | ||
const canvas = new Canvas({ | ||
container: dom, | ||
width: 400, | ||
height: 400, | ||
}); | ||
|
||
it('text of fontSize < 12 should be rendered', () => { | ||
const text = canvas.addShape('text', { | ||
attrs: { | ||
x: 50, | ||
y: 100, | ||
fontFamily: 'PingFang SC', | ||
text: '文本文本', | ||
fontSize: 10, | ||
stroke: 'red', | ||
}, | ||
}); | ||
const el = text.get('el'); | ||
expect(el.getAttribute('stroke')).eqls('red'); | ||
}); | ||
}); |