wip(core): Changes to support settings.scale. See #1638
This commit is contained in:
parent
3bf0f6f68b
commit
bb8a3a960e
3 changed files with 5 additions and 2 deletions
|
@ -182,6 +182,7 @@ Part.prototype.shorthand = function () {
|
|||
let sa = this.context.settings.complete ? this.context.settings.sa || 0 : 0
|
||||
const shorthand = {
|
||||
sa,
|
||||
scale: this.context.settings.scale,
|
||||
store: this.context.store,
|
||||
macro: this.macroClosure(),
|
||||
units: this.unitsClosure(),
|
||||
|
|
|
@ -58,6 +58,7 @@ export default function Pattern(config = { options: {} }) {
|
|||
locale: 'en',
|
||||
units: 'metric',
|
||||
margin: 2,
|
||||
scale: 1,
|
||||
layout: true,
|
||||
debug: true,
|
||||
scale: 1,
|
||||
|
|
|
@ -204,7 +204,7 @@ Svg.prototype.renderText = function (point) {
|
|||
}
|
||||
point.attributes.set('data-text-x', round(point.x))
|
||||
point.attributes.set('data-text-y', round(point.y))
|
||||
let lineHeight = point.attributes.get('data-text-lineheight') || 12
|
||||
let lineHeight = point.attributes.get('data-text-lineheight') || (6 * (this.pattern.settings.scale || 1))
|
||||
point.attributes.remove('data-text-lineheight')
|
||||
let svg = `${this.nl()}<text ${point.attributes.renderIfPrefixIs('data-text-')}>`
|
||||
this.indent()
|
||||
|
@ -238,7 +238,8 @@ Svg.prototype.renderCircle = function (point) {
|
|||
Svg.prototype.renderSnippet = function (snippet, part) {
|
||||
let x = round(snippet.anchor.x)
|
||||
let y = round(snippet.anchor.y)
|
||||
let scale = snippet.attributes.get('data-scale')
|
||||
let scale = snippet.attributes.get('data-scale') || 1
|
||||
scale = scale * (this.pattern.settings.scale || 1)
|
||||
if (scale) {
|
||||
snippet.attributes.add('transform', `translate(${x}, ${y})`)
|
||||
snippet.attributes.add('transform', `scale(${scale})`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue