mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 04:10:06 +00:00 
			
		
		
		
	Reorder initialization and rendering to prevent color flicker
This commit is contained in:
		
							parent
							
								
									5a0224631d
								
							
						
					
					
						commit
						dd3751313f
					
				
					 5 changed files with 21 additions and 5 deletions
				
			
		|  | @ -106,6 +106,12 @@ void ColorTableLayer::Render(const QMapbox::CustomLayerRenderParameters& params) | |||
| { | ||||
|    gl::OpenGLFunctions& gl = context()->gl_; | ||||
| 
 | ||||
|    if (!context()->radarProductView_->IsInitialized()) | ||||
|    { | ||||
|       // Defer rendering until view is initialized
 | ||||
|       return; | ||||
|    } | ||||
| 
 | ||||
|    glm::mat4 projection = glm::ortho(0.0f, | ||||
|                                      static_cast<float>(params.width), | ||||
|                                      0.0f, | ||||
|  |  | |||
|  | @ -274,8 +274,6 @@ void MapWidget::SelectRadarProduct(common::Level2Product product) | |||
|    util::async( | ||||
|       [=]() | ||||
|       { | ||||
|          radarProductView->Initialize(); | ||||
| 
 | ||||
|          std::string colorTableFile = | ||||
|             manager::SettingsManager::palette_settings()->palette( | ||||
|                common::GetLevel2Palette(product)); | ||||
|  | @ -285,6 +283,8 @@ void MapWidget::SelectRadarProduct(common::Level2Product product) | |||
|                common::ColorTable::Load(colorTableFile); | ||||
|             radarProductView->LoadColorTable(colorTable); | ||||
|          } | ||||
| 
 | ||||
|          radarProductView->Initialize(); | ||||
|       }); | ||||
| 
 | ||||
|    if (p->map_ != nullptr) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat