We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe this is working as intended, but I found it surprising.
var m = require("makerjs"); function box1() { return { paths: {}, origin: [0, 0], models: { inner: new m.models.Rectangle(10, 10) }, caption: { text: "B1", anchor: new m.paths.Line([5, 5], [5, 5]) } }; } function box2() { return { paths: {}, origin: [11, 0], models: { inner: new m.models.Rectangle(10, 10) }, caption: { text: "B2", anchor: new m.paths.Line([5, 5], [5, 5]) } }; } function main() { return { paths: {}, models: { box1: box1(), box2: box2() } }; } module.exports = main();
Each caption is in the middle of its box.
Captions are displayed on top of each other.
Calling originate() on the overall model puts the captions into their proper places:
originate()
function main() { return originate({ paths: {}, models: { box1: box1(), box2: box2() } }); }
I think this is very confusing, considering everything else is drawn relative to the model's origin.
If I put the caption in its own sub-model, then it works as I expected:
function box2() { return { paths: {}, origin: [11, 0], models: { inner: new m.models.Rectangle(10, 10), cap: { caption: { text: "B2", anchor: new m.paths.Line([5, 5], [5, 5]) } } } }; }
Is this the intended use case? If so addCaption is a little weird for not doing it that way.
addCaption
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out @hjfreyer - I believe your expectation is correct, I'll take a look.
Sorry, something went wrong.
No branches or pull requests
Maybe this is working as intended, but I found it surprising.
Steps to reproduce
Expected result
Each caption is in the middle of its box.
Actual result
Captions are displayed on top of each other.
Workaround
Calling
originate()
on the overall model puts the captions into their proper places:Commentary
I think this is very confusing, considering everything else is drawn relative to the model's origin.
If I put the caption in its own sub-model, then it works as I expected:
Is this the intended use case? If so
addCaption
is a little weird for not doing it that way.The text was updated successfully, but these errors were encountered: