mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
enhance: Increase max texture size
This commit is contained in:
parent
2063a5a096
commit
ec3e307933
1 changed files with 6 additions and 5 deletions
|
@ -55,18 +55,19 @@ class TachiyomiImageDecoder(private val resources: ImageSource, private val opti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxOf(bitmap.width, bitmap.height) > GLUtil.maxTextureSize) {
|
val maxTextureSize = 4096f
|
||||||
val widthRatio = bitmap.width / GLUtil.maxTextureSize.toFloat()
|
if (maxOf(bitmap.width, bitmap.height) > maxTextureSize) {
|
||||||
val heightRatio = bitmap.height / GLUtil.maxTextureSize.toFloat()
|
val widthRatio = bitmap.width / maxTextureSize
|
||||||
|
val heightRatio = bitmap.height / maxTextureSize
|
||||||
|
|
||||||
val targetWidth: Float
|
val targetWidth: Float
|
||||||
val targetHeight: Float
|
val targetHeight: Float
|
||||||
|
|
||||||
if (widthRatio >= heightRatio) {
|
if (widthRatio >= heightRatio) {
|
||||||
targetWidth = GLUtil.maxTextureSize.toFloat()
|
targetWidth = maxTextureSize
|
||||||
targetHeight = (targetWidth / bitmap.width) * bitmap.height
|
targetHeight = (targetWidth / bitmap.width) * bitmap.height
|
||||||
} else {
|
} else {
|
||||||
targetHeight = GLUtil.maxTextureSize.toFloat()
|
targetHeight = maxTextureSize
|
||||||
targetWidth = (targetHeight / bitmap.height) * bitmap.width
|
targetWidth = (targetHeight / bitmap.height) * bitmap.width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue