Skip to content

Commit

Permalink
Merge branch 'ravel-525-rename-rho-to-correlation' into ravel-548-pha…
Browse files Browse the repository at this point in the history
…ntom-pasted-items
  • Loading branch information
highperformancecoder committed May 7, 2024
2 parents a8289f2 + 9695394 commit 73a088c
Show file tree
Hide file tree
Showing 9 changed files with 318 additions and 276 deletions.
File renamed without changes
12 changes: 6 additions & 6 deletions model/sheet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,18 @@ namespace
default: // just to shut up the "maybe uninitialised" checker.
case ShowSlice::head:
tailStartRow=startRow=0;
numRows=height/rowHeight+1;
numRows=std::min(size, size_t(height/rowHeight+1));
break;
case ShowSlice::headAndTail:
startRow=0;
numRows=0.5*height/rowHeight-1;
numRows=std::min(size, size_t(0.5*height/rowHeight-1));
tailStartRow=size-numRows;
if (2*numRows*rowHeight>height)
if (numRows<size && 2*numRows*rowHeight>height)
tailStartRow++;
break;
case ShowSlice::tail:
numRows=height/rowHeight-1;
tailStartRow=startRow=size>numRows? size-numRows: 0;
numRows=std::min(size, size_t(height/rowHeight-1));
tailStartRow=startRow=size-numRows;
break;
}
}
Expand All @@ -256,7 +256,7 @@ namespace
row=tailStartRow; // for middle elision
y+=rowHeight;
}
return row>tailStartRow+numRows;
return row>=tailStartRow+numRows;
}
};
}
Expand Down
18 changes: 16 additions & 2 deletions test/00/allItemsRenderCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,31 @@ minsky.canvas.renderToSVG('allItemsOnBorder.svg')
for i in range(len(minsky.model.items)):
if minsky.model.items[i].classType() =="Sheet":
minsky.model.items[i].showSlice("headAndTail")
minsky.model.items[i].showRowSlice("headAndTail")
minsky.model.items[i].updateBoundingBox()
minsky.canvas.renderToSVG('allItemsHeadAndTail.svg')
for i in range(len(minsky.model.items)):
if minsky.model.items[i].classType()=="Sheet":
minsky.model.items[i].showSlice("tail")
minsky.model.items[i].showRowSlice("tail")
minsky.model.items[i].updateBoundingBox()
minsky.canvas.renderToSVG('allItemsTail.svg')
for i in range(len(minsky.model.items)):
if minsky.model.items[i].classType() =="Sheet":
minsky.model.items[i].showColSlice("headAndTail")
minsky.model.items[i].updateBoundingBox()
minsky.canvas.renderToSVG('allItemsColHeadAndTail.svg')
for i in range(len(minsky.model.items)):
if minsky.model.items[i].classType()=="Sheet":
minsky.model.items[i].showColSlice("tail")
minsky.model.items[i].updateBoundingBox()
minsky.canvas.renderToSVG('allItemsColTail.svg')
EOF

python3 input.py
Expand Down
90 changes: 49 additions & 41 deletions test/renderedImages/allItemsBare.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 73a088c

Please sign in to comment.