Added crest mode

This commit is contained in:
Devine Lu Linvega
2019-01-10 10:43:17 +12:00
parent 8c6d338b1a
commit 29b5b0fa66
4 changed files with 29 additions and 18 deletions

View File

@@ -28,16 +28,22 @@ function Manager (dotgrid) {
const paths = DOTGRID.tool.paths()
for (const id in this.layers) {
const style = styles[id]
const path = paths[id]
const layer = this.layers[id]
let style = styles[id]
let path = paths[id]
let layer = this.layers[id]
// Easter Egg
if (DOTGRID.tool.settings.crest === true) {
style = styles[0]
path = paths[0]
layer.setAttribute('transform', `rotate(${parseInt(id) * 120} ${(DOTGRID.tool.settings.size.width / 2) + 7.5} ${(DOTGRID.tool.settings.size.height / 2) + 15})`)
}
layer.style.strokeWidth = style.thickness
layer.style.strokeLinecap = style.strokeLinecap
layer.style.strokeLinejoin = style.strokeLinejoin
layer.style.stroke = style.color
layer.style.fill = style.fill
layer.style.transform = style.transform
layer.setAttribute('d', paths[id])
layer.setAttribute('d', path)
}
}