Skip to content
New issue

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

Exported diagram size should take curved edges into account #197

Open
varkor opened this issue Nov 28, 2023 · 0 comments
Open

Exported diagram size should take curved edges into account #197

varkor opened this issue Nov 28, 2023 · 0 comments
Labels
bug something isn't working embedded-diagrams regarding diagrams embedded via `<iframe>`

Comments

@varkor
Copy link
Owner

varkor commented Nov 28, 2023

See for instance this diagram, in which the exported <iframe> crops the curved edges at the sides. This is because diagram_size does not currently take edges into account.

quiver/src/ui.js

Lines 2471 to 2487 in 4a5f197

diagram_size() {
let [width, height] = [0, 0];
// Compute the extrema of the diagram.
const bounding_rect = this.quiver.bounding_rect();
if (bounding_rect === null) {
return Dimensions.zero();
}
const [[x_min, y_min], [x_max, y_max]] = bounding_rect;
// Sum to compute width and height.
for (let x = x_min; x <= x_max; ++x) {
width += this.cell_size(this.cell_width, x);
}
for (let y = y_min; y <= y_max; ++y) {
height += this.cell_size(this.cell_height, y);
}
return new Dimensions(width, height);
}

@varkor varkor added bug something isn't working embedded-diagrams regarding diagrams embedded via `<iframe>` labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working embedded-diagrams regarding diagrams embedded via `<iframe>`
Projects
None yet
Development

No branches or pull requests

1 participant