Skip to content

Commit

Permalink
Fix background remover draw path behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Jan 26, 2025
1 parent 16621e4 commit c3f7426
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import ru.tech.imageresizershrinker.feature.draw.data.utils.drawRepeatedTextOnPa
import ru.tech.imageresizershrinker.feature.draw.domain.DrawBehavior
import ru.tech.imageresizershrinker.feature.draw.domain.DrawLineStyle
import ru.tech.imageresizershrinker.feature.draw.domain.DrawMode
import ru.tech.imageresizershrinker.feature.draw.domain.DrawPathMode
import ru.tech.imageresizershrinker.feature.draw.domain.ImageDrawApplier
import ru.tech.imageresizershrinker.feature.draw.domain.PathPaint
import javax.inject.Inject
Expand Down Expand Up @@ -356,21 +355,27 @@ internal class AndroidImageDrawApplier @Inject constructor(
currentSize = canvasSize,
oldSize = size
)
this.drawPath(

drawPath(
path.asAndroidPath(),
Paint().apply {
style = if (mode is DrawPathMode.Lasso) {
PaintingStyle.Fill
} else PaintingStyle.Stroke
if (mode.isFilled) {
style = PaintingStyle.Fill
} else {
style = PaintingStyle.Stroke
this.strokeWidth = stroke.toPx(canvasSize)
if (mode.isSharpEdge) {
strokeCap = StrokeCap.Square
} else {
strokeCap = StrokeCap.Round
strokeJoin = StrokeJoin.Round
}
}
if (isRecoveryOn) {
shader = recoveryShader
} else {
blendMode = BlendMode.Clear
}
strokeCap = StrokeCap.Round
this.strokeWidth = stroke.toPx(canvasSize)
strokeJoin = StrokeJoin.Round

}.asFrameworkPaint().apply {
if (radius.value > 0f) {
maskFilter =
Expand Down

0 comments on commit c3f7426

Please sign in to comment.