🚧 Rendertest update
This commit is contained in:
parent
a7c518716b
commit
3754680841
10 changed files with 265 additions and 186 deletions
28
packages/rendertest/src/test.js
Normal file
28
packages/rendertest/src/test.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
import colors from "./colors";
|
||||
import circles from "./circles";
|
||||
import text from "./text";
|
||||
import snippets from "./snippets";
|
||||
import macros from "./macros";
|
||||
|
||||
export default function(part) {
|
||||
let { macro, store, options, Path, paths, Point } = part.shorthand();
|
||||
store.set("y", 0);
|
||||
store.set("w", options.width);
|
||||
macro("hd", {
|
||||
from: new Point(0, 0),
|
||||
to: new Point(options.width, 0)
|
||||
});
|
||||
if (options.colors) colors(part);
|
||||
if (options.circles) circles(part);
|
||||
if (options.text) text(part);
|
||||
if (options.snippets) snippets(part);
|
||||
if (options.macros) macros(part);
|
||||
|
||||
// Make sure no text is cut off
|
||||
paths.box = new Path()
|
||||
.move(new Point(0, -10))
|
||||
.line(new Point(store.get("w"), store.get("y")))
|
||||
.attr("class", "hidden");
|
||||
|
||||
return part;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue