diff options
author | rubidium <rubidium@openttd.org> | 2009-10-17 14:29:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-10-17 14:29:10 +0000 |
commit | d1d35b95b6e75a263b9395125af7d22faf02f462 (patch) | |
tree | daed0a809413d71060da91af4c67175989222a2e /src/ai/ai_gui.cpp | |
parent | 22ddb90fdbc45087064816ddb0cf0e0a27786db1 (diff) | |
download | openttd-d1d35b95b6e75a263b9395125af7d22faf02f462.tar.xz |
(svn r17786) -Fix [FS#3265]: graphical glitches (matrices/scrollbars with wrong 'size') upon reiniting windows
Diffstat (limited to 'src/ai/ai_gui.cpp')
-rw-r--r-- | src/ai/ai_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index b4808061b..b37bcd17f 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -205,7 +205,7 @@ struct AIListWindow : public Window { virtual void OnResize(Point delta) { - this->vscroll.UpdateCapacity(delta.y / this->line_height); + this->vscroll.SetCapacity(this->GetWidget<NWidgetCore>(AIL_WIDGET_LIST)->current_y / this->line_height); this->GetWidget<NWidgetCore>(AIL_WIDGET_LIST)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); } }; @@ -401,7 +401,7 @@ struct AISettingsWindow : public Window { virtual void OnResize(Point delta) { - this->vscroll.UpdateCapacity(delta.y / this->line_height); + this->vscroll.SetCapacity(this->GetWidget<NWidgetCore>(AIS_WIDGET_BACKGROUND)->current_y / this->line_height); this->GetWidget<NWidgetCore>(AIS_WIDGET_BACKGROUND)->widget_data = (this->vscroll.GetCapacity() << MAT_ROW_START) + (1 << MAT_COL_START); } @@ -662,8 +662,6 @@ struct AIDebugWindow : public Window { AIDebugWindow(const WindowDesc *desc, WindowNumber number) : Window() { - this->vscroll.SetCapacity(14); // Minimal number of lines in the log panel. - this->InitNested(desc, number); /* Disable the companies who are not active or not an AI */ for (CompanyID i = COMPANY_FIRST; i < MAX_COMPANIES; i++) { @@ -671,6 +669,8 @@ struct AIDebugWindow : public Window { } this->DisableWidget(AID_WIDGET_RELOAD_TOGGLE); + this->vscroll.SetCapacity(this->GetWidget<NWidgetBase>(AID_WIDGET_LOG_PANEL)->current_y / this->resize.step_height); + this->last_vscroll_pos = 0; this->autoscroll = true; @@ -681,7 +681,7 @@ struct AIDebugWindow : public Window { { if (widget == AID_WIDGET_LOG_PANEL) { resize->height = FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL; - size->height = this->vscroll.GetCapacity() * resize->height + this->top_offset + this->bottom_offset; + size->height = 14 * resize->height + this->top_offset + this->bottom_offset; } } @@ -878,7 +878,7 @@ struct AIDebugWindow : public Window { virtual void OnResize(Point delta) { - this->vscroll.UpdateCapacity(delta.y / (int)this->resize.step_height); + this->vscroll.SetCapacity(this->GetWidget<NWidgetBase>(AID_WIDGET_LOG_PANEL)->current_y / this->resize.step_height); } }; |