Skip to content

Commit

Permalink
[4.1.0] Last minute fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellins-swile committed Dec 29, 2023
1 parent 0b78152 commit 31e3ea1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/commonMain/kotlin/qrcode/shape/DefaultShapeFunction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ open class DefaultShapeFunction(val squareSize: Int = DEFAULT_CELL_SIZE, innerSp
val fg = colorFn.fg(square.row, square.col, qrCode, canvas)

if (square.squareInfo.type == MARGIN) {
canvas.fill(bg)
}
else if (square.dark) {
val margin = colorFn.margin(square.row, square.col, qrCode, canvas)
canvas.fill(margin)
} else {
val color = if (square.dark) fg else bg

fillRect(
x + innerSpacing,
y + innerSpacing,
squareSize - innerSpacing * 2,
squareSize - innerSpacing * 2,
fg,
color,
canvas,
)
}
Expand Down

0 comments on commit 31e3ea1

Please sign in to comment.