parent
0a3cc9a886
commit
b4314f5f0b
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Snow Machine Translations'
|
||||
extClass = '.SnowmtlFactory'
|
||||
extVersionCode = 5
|
||||
extVersionCode = 6
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class ComposedImageInterceptor(
|
|||
}
|
||||
|
||||
private fun createTextPaint(font: Typeface?): TextPaint {
|
||||
val defaultTextSize = 50.sp // arbitrary
|
||||
val defaultTextSize = 24.pt // arbitrary
|
||||
return TextPaint().apply {
|
||||
color = Color.BLACK
|
||||
textSize = defaultTextSize
|
||||
|
@ -258,7 +258,8 @@ class ComposedImageInterceptor(
|
|||
restore()
|
||||
}
|
||||
|
||||
private val Int.sp: Float get() = this * SCALED_DENSITY
|
||||
// https://pixelsconverter.com/pt-to-px
|
||||
private val Int.pt: Float get() = this / SCALED_DENSITY
|
||||
|
||||
// ============================= Utils ======================================
|
||||
|
||||
|
@ -283,7 +284,8 @@ class ComposedImageInterceptor(
|
|||
}
|
||||
|
||||
companion object {
|
||||
const val SCALED_DENSITY = 1.5f // arbitrary
|
||||
// w3: Absolute Lengths [...](https://www.w3.org/TR/css3-values/#absolute-lengths)
|
||||
const val SCALED_DENSITY = 0.75f // 1px = 0.75pt
|
||||
val mediaType = "image/png".toMediaType()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue