Make macros upToDate with documentation
This commit is contained in:
parent
51b68a14cf
commit
e95d2f0353
3 changed files with 8 additions and 8 deletions
|
@ -1,8 +1,8 @@
|
||||||
// Export macros
|
// Export macros
|
||||||
export const crossboxMacros = {
|
export const crossboxMacros = {
|
||||||
crossbox: function (so, { points, Point, paths, Path, getId }) {
|
crossbox: function (so, { points, Point, paths, Path, getId }) {
|
||||||
let id = getId()
|
const id = getId()
|
||||||
let shiftFraction = 0.1
|
const shiftFraction = 0.1
|
||||||
points[id + '_boxTopLeft'] = so.from.copy()
|
points[id + '_boxTopLeft'] = so.from.copy()
|
||||||
points[id + '_boxBottomRight'] = so.to.copy()
|
points[id + '_boxBottomRight'] = so.to.copy()
|
||||||
points[id + '_boxTopRight'] = new Point(so.to.x, so.from.y)
|
points[id + '_boxTopRight'] = new Point(so.to.x, so.from.y)
|
||||||
|
@ -44,7 +44,7 @@ export const crossboxMacros = {
|
||||||
.line(points[id + '_topCrossBL'])
|
.line(points[id + '_topCrossBL'])
|
||||||
.attr('class', 'lining dotted stroke-sm')
|
.attr('class', 'lining dotted stroke-sm')
|
||||||
if (typeof so.text === 'string') {
|
if (typeof so.text === 'string') {
|
||||||
points.textAnchor = points[id + '_boxTopLeft']
|
points[id + 'textAnchor'] = points[id + '_boxTopLeft']
|
||||||
.shiftFractionTowards(points[id + '_boxBottomRight'], 0.5)
|
.shiftFractionTowards(points[id + '_boxBottomRight'], 0.5)
|
||||||
.attr('data-text', so.text)
|
.attr('data-text', so.text)
|
||||||
.attr('data-text-class', 'center')
|
.attr('data-text-class', 'center')
|
||||||
|
|
|
@ -30,8 +30,8 @@ export const pleatMacros = {
|
||||||
...so,
|
...so,
|
||||||
}
|
}
|
||||||
if (complete) {
|
if (complete) {
|
||||||
points[so.prefix + 'From'] = so.from
|
points[so.prefix + 'From'] = so.from.copy()
|
||||||
points[so.prefix + 'To'] = so.to
|
points[so.prefix + 'To'] = so.to.copy()
|
||||||
points[so.prefix + 'FromIn'] = points[so.prefix + 'From'].shift(
|
points[so.prefix + 'FromIn'] = points[so.prefix + 'From'].shift(
|
||||||
so.from.shiftTowards(so.to, 0.1).angle(so.from) + 270,
|
so.from.shiftTowards(so.to, 0.1).angle(so.from) + 270,
|
||||||
so.margin * scale
|
so.margin * scale
|
||||||
|
|
|
@ -45,9 +45,9 @@ export const sewtogetherMacros = {
|
||||||
if (null == so.middle) {
|
if (null == so.middle) {
|
||||||
so.middle = so.from.shiftFractionTowards(so.to, 0.5)
|
so.middle = so.from.shiftFractionTowards(so.to, 0.5)
|
||||||
}
|
}
|
||||||
points[so.prefix + 'From'] = so.from
|
points[so.prefix + 'From'] = so.from.copy()
|
||||||
points[so.prefix + 'Middle'] = so.middle
|
points[so.prefix + 'Middle'] = so.middle.copy()
|
||||||
points[so.prefix + 'To'] = so.to
|
points[so.prefix + 'To'] = so.to.copy()
|
||||||
|
|
||||||
points[so.prefix + 'FromCp'] = points[so.prefix + 'From'].shift(
|
points[so.prefix + 'FromCp'] = points[so.prefix + 'From'].shift(
|
||||||
points[so.prefix + 'From'].angle(points[so.prefix + 'Middle']) + 90,
|
points[so.prefix + 'From'].angle(points[so.prefix + 'Middle']) + 90,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue