-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from antvis/fix-issue-240
fix(g-svg): should get correct path for marker
- Loading branch information
Showing
4 changed files
with
41 additions
and
7 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
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,34 @@ | ||
const expect = require('chai').expect; | ||
import Canvas from '../../src/canvas'; | ||
|
||
const dom = document.createElement('div'); | ||
document.body.appendChild(dom); | ||
dom.id = 'c1'; | ||
|
||
describe('#240', () => { | ||
const canvas = new Canvas({ | ||
container: dom, | ||
width: 600, | ||
height: 600, | ||
}); | ||
|
||
it('should get correct path for marker', () => { | ||
const shape = canvas.addShape('marker', { | ||
attrs: { | ||
lineWidth: 1, | ||
fill: '#1890ff', | ||
r: 16.6, | ||
opacity: 0.3, | ||
x: 247.22381317138678, | ||
y: 153.66500000000002, | ||
symbol: 'circle', | ||
}, | ||
}); | ||
|
||
const el = shape.get('el'); | ||
const path = el.getAttribute('d'); | ||
expect(path).eqls( | ||
'M 247.22381317138678 153.66500000000002m -16.6 0a 16.6 16.6 0 1 0 33.2 0a 16.6 16.6 0 1 0 -33.2 0' | ||
); | ||
}); | ||
}); |
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