From 2198b5e10dcadfcaf270dac4a6148dd70b733a25 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 6 Mar 2021 19:10:24 -0500 Subject: [PATCH] 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. --- .../cacao/viewcontroller/TabViewController.kt | 5 +++-- .../assets/phycon/textures/gui/tabs.png | Bin 0 -> 1055 bytes 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/assets/phycon/textures/gui/tabs.png diff --git a/src/main/kotlin/net/shadowfacts/cacao/viewcontroller/TabViewController.kt b/src/main/kotlin/net/shadowfacts/cacao/viewcontroller/TabViewController.kt index e1d4ca0..4019b30 100644 --- a/src/main/kotlin/net/shadowfacts/cacao/viewcontroller/TabViewController.kt +++ b/src/main/kotlin/net/shadowfacts/cacao/viewcontroller/TabViewController.kt @@ -7,6 +7,7 @@ import net.shadowfacts.cacao.geometry.Axis import net.shadowfacts.cacao.geometry.Point import net.shadowfacts.cacao.geometry.Rect import net.shadowfacts.cacao.geometry.Size +import net.shadowfacts.cacao.util.Color import net.shadowfacts.cacao.util.MouseButton import net.shadowfacts.cacao.util.texture.NinePatchTexture import net.shadowfacts.cacao.util.texture.Texture @@ -239,7 +240,7 @@ class TabViewController( padding = 2.0 ) { companion object { - val BACKGROUND = Identifier("textures/gui/container/creative_inventory/tabs.png") + val BACKGROUND = Identifier("phycon:textures/gui/tabs.png") } private var selected = false @@ -293,7 +294,7 @@ class TabViewController( val u = when { superview == null -> 0 frame.left == 0.0 -> 0 - frame.right == superview!!.bounds.right -> 140 + frame.right == superview!!.bounds.right -> 56 else -> 28 } backgroundView.texture = Texture(BACKGROUND, u, v) diff --git a/src/main/resources/assets/phycon/textures/gui/tabs.png b/src/main/resources/assets/phycon/textures/gui/tabs.png new file mode 100644 index 0000000000000000000000000000000000000000..1b50118e9208959fa5b071543f0522f0487042a5 GIT binary patch literal 1055 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|G$5xX)7d$|)7e>}peR2rGbfdS zL1SX=L|c!;4l+mMgSRS)vTJv6q^T;$pn~wCygxl0Tjwy(IFjLTY?kwd#f$mnZu&5cLzP%NbELLS%J>{0{ z4?Pz>XKPTa>AREh66ao?_KsO@*})>VfrC>?BxFOQP|lHztDYMtEc&~nzy82i?k|JP~L zgkO`tWCeH2G1}ffaI`cy_*=ti*#-YkPVl`swaKKlMy|qsasDZ$z1tnGueu(cEWe!J zVb(6MdkpOD2Rs@#U9Y)!_vWqJ`_rZV{$*hKUsSCzvnl}?Eo@2N?k)`fL2$v|<&%LT zoCO|{#S9GG!XV7ZFl&wkP>{XE)7O>#DKndxlA`pp9z_NQCK*o`$B>F!Z|^$hH5-Vy zUi6=;yGd)pCjJ}j9ywipQk+-Jnz^k1p0iwhZeG+?bGf5}Kw}PAzu>cfKeg;$D*q*x zg!|u%o-cmAD}Q5V4S&!NjamyOrM5(iI;QRW*jMH;EN3?Ad;C=S_BL0SBR1#zg>QbE zH=6+{?#h4Mc