Fix weird tab appearance at certain resolutions
There's 1 physical pixel of error creeping in somewhere which was being displayed below the selected tab. Workaround it by using a tab texture which has transparent pixels below the bottom of the select tabs.
This commit is contained in:
parent
1c405f8623
commit
2198b5e10d
|
@ -7,6 +7,7 @@ import net.shadowfacts.cacao.geometry.Axis
|
||||||
import net.shadowfacts.cacao.geometry.Point
|
import net.shadowfacts.cacao.geometry.Point
|
||||||
import net.shadowfacts.cacao.geometry.Rect
|
import net.shadowfacts.cacao.geometry.Rect
|
||||||
import net.shadowfacts.cacao.geometry.Size
|
import net.shadowfacts.cacao.geometry.Size
|
||||||
|
import net.shadowfacts.cacao.util.Color
|
||||||
import net.shadowfacts.cacao.util.MouseButton
|
import net.shadowfacts.cacao.util.MouseButton
|
||||||
import net.shadowfacts.cacao.util.texture.NinePatchTexture
|
import net.shadowfacts.cacao.util.texture.NinePatchTexture
|
||||||
import net.shadowfacts.cacao.util.texture.Texture
|
import net.shadowfacts.cacao.util.texture.Texture
|
||||||
|
@ -239,7 +240,7 @@ class TabViewController<T: TabViewController.Tab>(
|
||||||
padding = 2.0
|
padding = 2.0
|
||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
val BACKGROUND = Identifier("textures/gui/container/creative_inventory/tabs.png")
|
val BACKGROUND = Identifier("phycon:textures/gui/tabs.png")
|
||||||
}
|
}
|
||||||
|
|
||||||
private var selected = false
|
private var selected = false
|
||||||
|
@ -293,7 +294,7 @@ class TabViewController<T: TabViewController.Tab>(
|
||||||
val u = when {
|
val u = when {
|
||||||
superview == null -> 0
|
superview == null -> 0
|
||||||
frame.left == 0.0 -> 0
|
frame.left == 0.0 -> 0
|
||||||
frame.right == superview!!.bounds.right -> 140
|
frame.right == superview!!.bounds.right -> 56
|
||||||
else -> 28
|
else -> 28
|
||||||
}
|
}
|
||||||
backgroundView.texture = Texture(BACKGROUND, u, v)
|
backgroundView.texture = Texture(BACKGROUND, u, v)
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
Loading…
Reference in New Issue