Browse Source

Fix BG2 acc item icons clipping at the end of list

habeebweeb 4 years ago
parent
commit
6fc22f4160
1 changed files with 6 additions and 7 deletions
  1. 6 7
      MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

+ 6 - 7
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs

@@ -708,30 +708,29 @@ namespace CM3D2.MultipleMaids.Plugin
                 position1 = new Rect(GetPix(7),
                                       GetPix(138),
                                       GetPix(44) * 4 + GetPix(20),
-                                     rectWin.height * 0.785f);
+                                      rectWin.height - GetPix(148));
                 viewRect = new Rect(0.0f,
                                     0.0f,
                                     position1.width * 0.845f,
-                                    pix * (float)Math.Ceiling(sortList.Count / 4.0) + GetPix(5));
+                                    Mathf.Ceil(sortList.Count / 4 + 1) * pix + GetPix(10));
             }
             else
             {
                 position1 = new Rect(GetPix(7),
                                       GetPix(138),
                                       GetPix(44) * 4 + GetPix(20),
-                                     (float)(rectWin.height * 0.785000026226044 * 0.959999978542328));
+                                      rectWin.height - GetPix(148));
                 viewRect = new Rect(0.0f,
                                     0.0f,
                                     position1.width * 0.845f,
-                                    (float)(pix * Math.Ceiling(sortList.Count / 4.0)
-                                             + GetPix(5) * 0.920000016689301));
+                                    Mathf.Ceil(sortList.Count / 4 + 1) * pix + GetPix(10));
             }
 
             scrollPos = GUI.BeginScrollView(position1, scrollPos, viewRect);
             for (int index = 0; index < sortList.Count; ++index)
             {
-                Rect position2 = new Rect(GetPix(index % 4 * 45),
-                                           GetPix(index / 4 * 45),
+                Rect position2 = new Rect(index % 4 * GetPix(45),
+                                           index / 4 * GetPix(45),
                                            GetPix(44),
                                            GetPix(44));
                 if (GUI.Button(position2, sortList[index].tex))