Skip to content

Commit 80a99de

Browse files
authored
Merge pull request #98 from code-payments/fix/receipt-shape-render
fix(receipt/shape): ensure rendering starts at corner
2 parents 1ca6f29 + 2cd9bd7 commit 80a99de

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/main/java/com/getcode/view/shapes/TriangleCutShape.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ import kotlin.random.Random
2828
class TriangleCutShape(private val cutStep: Dp = 10.dp) : androidx.compose.ui.graphics.Shape {
2929

3030
private fun makeCutPath(size: Size, stepX: Float, height: Float, topClosed: Boolean): Path {
31-
val localHeight = if (topClosed) height else -height;
31+
val localHeight = if (topClosed) height else -height
3232
val startPt = PointF(0f, if (topClosed) 0f else height)
33-
val seq = generateSequence(startPt) {
33+
val seq = listOf(PointF(0f, startPt.y)) + generateSequence(startPt) {
3434
PointF(it.x.plus(stepX), if (it.y == startPt.y) startPt.y + localHeight else startPt.y)
3535
}.takeWhile { it.x <= (size.width + stepX) }
36+
3637
return Path().apply {
3738
moveTo(startPt.x, startPt.y)
3839
seq.forEach { lineTo(it.x, it.y) }

0 commit comments

Comments
 (0)