1
0
Fork 0
freesewing/packages/examples/src/point_translate.js

22 lines
551 B
JavaScript
Raw Normal View History

2019-08-03 15:03:33 +02:00
import { box } from './shared'
2019-05-25 11:11:46 +02:00
2019-01-27 12:54:18 +01:00
export default part => {
2019-08-03 15:03:33 +02:00
let { Point, points, macro } = part.shorthand()
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
points.A = new Point(20, 20).attr('data-text', 'Point A')
2019-01-27 12:54:18 +01:00
points.B = points.A.translate(120, 60)
2019-08-03 15:03:33 +02:00
.attr('data-text', 'Point B is point A with a\ntranslate(120, 60)\ntransform applied')
.attr('data-text-class', 'right')
.attr('data-text-dy', -6)
.attr('data-text-lineheight', 6)
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
macro('ld', {
2019-01-27 12:54:18 +01:00
from: points.A,
to: points.B,
2019-08-03 15:03:33 +02:00
text: 'translate(120,60)',
2019-01-27 12:54:18 +01:00
noStartMarker: true
2019-08-03 15:03:33 +02:00
})
2019-01-27 12:54:18 +01:00
2019-08-03 15:03:33 +02:00
return box(part, 150, 85)
}