Skip to content

Commit

Permalink
add more space for one way view
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Aug 20, 2024
1 parent 82b0dd7 commit 2521b87
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions js/views/templates/onewayview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const topMargin = 50;
const horizontalGapPercentage = 0.5;

export function oneWayView(viewObjects, fromCollectionName, relationName) {
const relations =
viewObjects.datatypes[fromCollectionName].oneToOne[relationName];
Expand All @@ -11,8 +14,8 @@ export function oneWayView(viewObjects, fromCollectionName, relationName) {

const fromWidth = fromCollection[0].width;
const toWidth = toCollection[0].width;
const fromHorizontalGap = 0.3 * fromWidth;
const toHorizontalGap = 0.3 * toWidth;
const fromHorizontalGap = horizontalGapPercentage * fromWidth;
const toHorizontalGap = horizontalGapPercentage * toWidth;
const gap = 2 * (fromWidth + toWidth);
const totalWidth = gap + fromWidth + toWidth;

Expand All @@ -38,10 +41,10 @@ export function oneWayView(viewObjects, fromCollectionName, relationName) {
toCollection[i].x = toX;

const space = height + verticalGap;
fromCollection[i].y = accHeight + space / 2 - fromHeight / 2;
toCollection[i].y = accHeight + space / 2 - toHeight / 2;
fromCollection[i].y = topMargin + accHeight + space / 2 - fromHeight / 2;
toCollection[i].y = topMargin + accHeight + space / 2 - toHeight / 2;
accHeight += height + verticalGap;
}

return [width, totalHeight];
return [width, totalHeight + topMargin];
}

0 comments on commit 2521b87

Please sign in to comment.