Changeset - r28320:85f81f36bffe
[Not reviewed]
master
0 2 0
Peter Nelson - 11 months ago 2023-12-23 13:17:33
peter1138@openttd.org
Fix #11618: Don't try to display unavailable zoom levels in sprite aligner. (#11619)
2 files changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_debug_gui.cpp
Show inline comments
 
@@ -827,6 +827,7 @@ struct SpriteAlignerWindow : Window {
 
	{
 
		/* On first opening, set initial zoom to current zoom level. */
 
		if (SpriteAlignerWindow::zoom == ZOOM_LVL_END) SpriteAlignerWindow::zoom = _gui_zoom;
 
		SpriteAlignerWindow::zoom = Clamp(SpriteAlignerWindow::zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max);
 

	
 
		this->CreateNestedTree();
 
		this->vscroll = this->GetScrollbar(WID_SA_SCROLLBAR);
 
@@ -1073,7 +1074,9 @@ struct SpriteAlignerWindow : Window {
 
			this->vscroll->SetCount(_newgrf_debug_sprite_picker.sprites.size());
 
		}
 

	
 
		SpriteAlignerWindow::zoom = Clamp(SpriteAlignerWindow::zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max);
 
		for (ZoomLevel z = ZOOM_LVL_NORMAL; z < ZOOM_LVL_END; z++) {
 
			this->SetWidgetsDisabledState(z < _settings_client.gui.zoom_min || z > _settings_client.gui.zoom_max, WID_SA_ZOOM + z);
 
			this->SetWidgetsLoweredState(SpriteAlignerWindow::zoom == z, WID_SA_ZOOM + z);
 
		}
 
	}
src/settings_table.cpp
Show inline comments
 
@@ -265,6 +265,7 @@ static void ZoomMinMaxChanged(int32_t)
 
{
 
	ConstrainAllViewportsZoom();
 
	GfxClearSpriteCache();
 
	InvalidateWindowClassesData(WC_SPRITE_ALIGNER);
 
	if (AdjustGUIZoom(false)) {
 
		ReInitAllWindows(true);
 
	}
0 comments (0 inline, 0 general)