File tree Expand file tree Collapse file tree
app/src/main/java/me/rosuh/easywatermark/utils/ktx Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import android.graphics.Typeface
66import android.text.TextPaint
77import me.rosuh.easywatermark.data.model.ImageInfo
88import me.rosuh.easywatermark.data.model.WaterMark
9- import me.rosuh.easywatermark.render.WatermarkRenderer
9+ import me.rosuh.easywatermark.render.WatermarkGeometry
1010
1111/* *
1212 * S3a image-space sizing: the text paint size is `textSize * imageInfo.width / REF_WIDTH`, i.e.
@@ -28,7 +28,7 @@ fun Paint.applyConfig(
2828 @Suppress(" UNUSED_PARAMETER" ) isScale : Boolean = true
2929): Paint {
3030 val size = config?.textSize ? : 14f
31- textSize = size * imageInfo.width / WatermarkRenderer . REF_WIDTH
31+ textSize = WatermarkGeometry .fontPx( size, imageInfo.width)
3232 color = config?.textColor ? : Color .RED
3333 alpha = config?.alpha ? : 128
3434 style = config?.textStyle?.obtainSysStyle() ? : Paint .Style .FILL
You can’t perform that action at this time.
0 commit comments