mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 03:33:24 +01:00
Cleanup
This commit is contained in:
parent
975da5c4bb
commit
29d132c167
@ -301,6 +301,13 @@ class Snowmtl : ParsedHttpSource() {
|
||||
else -> it.y1.toFloat()
|
||||
}
|
||||
|
||||
// Invert color in black dialog box
|
||||
paint.apply {
|
||||
val pixelColor = bitmap.getPixel(it.centerX.toInt(), it.centerY.toInt())
|
||||
val inverseColor = (Color.WHITE - pixelColor) or Color.BLACK
|
||||
color = inverseColor
|
||||
}
|
||||
|
||||
lines.forEachIndexed { index, line ->
|
||||
// Centers the text on the X axis and positions it inside the dialog box
|
||||
val x = (it.centerX - (line.length * paint.getCharWidth() / 2)).absoluteValue + marginLeft
|
||||
@ -308,12 +315,6 @@ class Snowmtl : ParsedHttpSource() {
|
||||
// Positions the text inside the dialog box on the Y axis
|
||||
val y = (initialY + paint.getCharHeight() * index * spaceBetween).absoluteValue + marginTop
|
||||
|
||||
// Invert color in black dialog box
|
||||
val pixelColor = bitmap.getPixel(it.centerX.toInt(), it.centerY.toInt())
|
||||
val inverseColor = (Color.WHITE - pixelColor) or Color.BLACK
|
||||
|
||||
paint.color = inverseColor
|
||||
|
||||
canvas.drawText(line, 0, line.length, x, y, paint)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user