Loading

Paste #ptizrj53b

  1. Index: src/depot_gui.cpp
  2. ===================================================================
  3. --- src/depot_gui.cpp   (revision 27935)
  4. +++ src/depot_gui.cpp   (working copy)
  5. @@ -383,12 +383,13 @@
  6.             int col = _colour_gradient[wid->colour][4];
  7.             int image_left  = rtl ? r.left  + this->count_width  : r.left  + this->header_width;
  8.             int image_right = rtl ? r.right - this->header_width : r.right - this->count_width;
  9. +           int first_line = w + (-this->hscroll->GetPosition()) % w;
  10.             if (rtl) {
  11. -               for (int x = image_right - w; x > image_left; x -= w) {
  12. +               for (int x = image_right - first_line; x >= image_left; x -= w) {
  13.                     GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3);
  14.                 }
  15.             } else {
  16. -               for (int x = image_left + w; x < image_right; x += w) {
  17. +               for (int x = image_left + first_line; x <= image_right; x += w) {
  18.                     GfxDrawLine(x, r.top, x, r.bottom, col, 1, 3);
  19.                 }
  20.             }
  21. @@ -734,7 +735,8 @@
  22.             }
  23.             /* Always have 1 empty row, so people can change the setting of the train */
  24.             this->vscroll->SetCount(this->vehicle_list.Length() + this->wagon_list.Length() + 1);
  25. -           this->hscroll->SetCount(max_width);
  26. +           /* Always make it longer than the longest train, so you can attach vehicles at the end, and also see the next vertical tile separator line */
  27. +           this->hscroll->SetCount(max_width + ScaleGUITrad(VEHICLEINFO_FULL_VEHICLE_WIDTH + 1));
  28.         } else {
  29.             this->vscroll->SetCount(CeilDiv(this->vehicle_list.Length(), this->num_columns));
  30.         }
  31. Index: src/train_gui.cpp
  32. ===================================================================
  33. --- src/train_gui.cpp   (revision 27935)
  34. +++ src/train_gui.cpp   (working copy)
  35. @@ -64,14 +64,14 @@
  36.     bool rtl = _current_text_dir == TD_RTL;
  37.  
  38.     assert(selection != INVALID_VEHICLE);
  39. -   int dragged_width = WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
  40. +   int dragged_width = 0;
  41.     for (Train *t = Train::Get(selection); t != NULL; t = chain ? t->Next() : (t->HasArticulatedPart() ? t->GetNextArticulatedPart() : NULL)) {
  42.         dragged_width += t->GetDisplayImageWidth(NULL);
  43.     }
  44.  
  45. -   int drag_hlight_left = rtl ? max(px -dragged_width, 0) : px;
  46. -   int drag_hlight_right = rtl ? px : min(px + dragged_width, max_width);
  47. -   int drag_hlight_width = max(drag_hlight_right - drag_hlight_left, 0);
  48. +   int drag_hlight_left = rtl ? max(px - dragged_width + 1, 0) : px;
  49. +   int drag_hlight_right = rtl ? px : min(px + dragged_width, max_width) - 1;
  50. +   int drag_hlight_width = max(drag_hlight_right - drag_hlight_left + 1, 0);
  51.  
  52.     if (drag_hlight_width > 0) {
  53.         GfxFillRect(drag_hlight_left + WD_FRAMERECT_LEFT, WD_FRAMERECT_TOP + 1,
  54.  

Comments