1
0
Fork 0

Honor scale in plugin-theme.

Step 1 in addressing #1638.
This commit is contained in:
Nick Dower 2022-01-13 19:45:44 +01:00
parent 1135b3507c
commit c7c6287a0c
4 changed files with 175 additions and 155 deletions

View file

@ -24,4 +24,20 @@ describe('Theme Plugin Tests', () => {
expect(pattern.svg.defs).to.contain('gridline-sm')
expect(pattern.svg.defs).to.contain('M 12.7 0 L 12.7')
});
it("Should apply scale.", () => {
expect(pattern.svg.style).to.contain('svg.freesewing .text-xxl {\n font-size: 12px')
pattern.settings.scale = 2
pattern.draft().render()
expect(pattern.svg.style).to.contain('svg.freesewing .text-xxl {\n font-size: 24px;')
})
it("Should round after applying scale.", () => {
pattern.settings.scale = 1/3
pattern.draft().render()
expect(pattern.svg.style).to.contain('svg.freesewing .text-xxl {\n font-size: 4px')
})
})