2019-05-25 11:11:46 +02:00
|
|
|
import { box } from "./shared";
|
|
|
|
|
2019-01-27 12:54:18 +01:00
|
|
|
export default part => {
|
2019-05-25 11:11:46 +02:00
|
|
|
let { Point, points, macro } = part.shorthand();
|
2019-01-27 12:54:18 +01:00
|
|
|
|
2019-05-25 11:11:46 +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)
|
|
|
|
.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);
|
|
|
|
|
|
|
|
macro("ld", {
|
|
|
|
from: points.A,
|
|
|
|
to: points.B,
|
|
|
|
text: "translate(120,60)",
|
|
|
|
noStartMarker: true
|
|
|
|
});
|
|
|
|
|
2019-05-25 11:11:46 +02:00
|
|
|
return box(part, 150, 85);
|
2019-01-27 12:54:18 +01:00
|
|
|
};
|