Skip to content

Commit

Permalink
Fix Watermark Text sizing doesn't match preview by #1276
Browse files Browse the repository at this point in the history
  • Loading branch information
T8RIN committed Aug 23, 2024
1 parent 553db0f commit ba6c092
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import ru.tech.imageresizershrinker.feature.watermarking.domain.WatermarkApplier
import ru.tech.imageresizershrinker.feature.watermarking.domain.WatermarkParams
import ru.tech.imageresizershrinker.feature.watermarking.domain.WatermarkingType
import javax.inject.Inject
import kotlin.math.min
import kotlin.math.roundToInt

internal class AndroidWatermarkApplier @Inject constructor(
Expand All @@ -62,7 +61,9 @@ internal class AndroidWatermarkApplier @Inject constructor(
.setTextAlpha(
(params.alpha * 255).roundToInt()
)
.setTextSize(min(image.width, image.height) * type.size.toDouble())
.setTextSize(
type.size.toDouble()
)
.setBackgroundColor(type.backgroundColor)
.setTextColor(type.color)
.setTextFont(type.font)
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ versionCode = "149"
jvmTarget = "17"
compose-compiler = "1.5.15"

imageToolboxLibs = "2.2.2"
imageToolboxLibs = "2.2.3"
trickle = "1.1.2"

avifCoder = "1.8.0"
Expand All @@ -28,7 +28,7 @@ konfettiCompose = "2.0.4"
reimagined = "1.5.0"
shadowsPlus = "1.0.4"
exifinterface = "1.3.7"
firebaseAnalyticsKtx = "22.0.2"
firebaseAnalyticsKtx = "22.1.0"
firebaseCrashlyticsGradle = "3.0.2"
google-segmentationSelfie = "16.0.0-beta6"
google-subjectSegmentation = "16.0.0-beta1"
Expand Down

0 comments on commit ba6c092

Please sign in to comment.