Skip to content

Commit

Permalink
Do not use row.visibleElement in pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Apr 22, 2024
1 parent a043c85 commit d8af438
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/flat_layout/flat_survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ export class FlatSurvey {
const width: number = SurveyHelper.getPageAvailableWidth(controller);
let nextMarginLeft: number = controller.margins.left;
const rowFlats: IPdfBrick[] = [];
for (let i: number = 0; i < row.visibleElements.length; i++) {
let element: IElement = row.visibleElements[i];
const visibleElements = row.elements.filter(el => el.isVisible);
for (let i: number = 0; i < visibleElements.length; i++) {
let element: IElement = visibleElements[i];
if (!element.isVisible) continue;
const persWidth: number = SurveyHelper.parseWidth(element.renderWidth,
width - (row.visibleElements.length - 1) * controller.unitWidth,
row.visibleElements.length);
width - (visibleElements.length - 1) * controller.unitWidth,
visibleElements.length);
controller.margins.left = nextMarginLeft + ((i !== 0) ? controller.unitWidth : 0);
controller.margins.right = controller.paperWidth - controller.margins.left - persWidth;
currPoint.xLeft = controller.margins.left;
Expand Down

0 comments on commit d8af438

Please sign in to comment.