Skip to content

Commit f5e96fd

Browse files
committed
fix CustomImage edge case
1 parent 47a46b2 commit f5e96fd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

visuals/CustomImage.opal

+6-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ new class CustomImage: LineVisual {
147147
this.auxChunks.append(this.image.subsurface((x, yStart, this.auxLineSize, this.top)));
148148
}
149149

150-
this.auxMapFactor = len(this.auxChunks) / sortingVisualizer.auxMax;
150+
if len(this.auxChunks) == 0 {
151+
this.auxChunks.append(this.image.subsurface(0, yStart, sortingVisualizer.graphics.resolution.x, this.top));
152+
this.auxMapFactor = 0;
153+
} else {
154+
this.auxMapFactor = len(this.auxChunks) / sortingVisualizer.auxMax;
155+
}
151156
}
152157

153158
new method onAuxOff() {

0 commit comments

Comments
 (0)