mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:30:05 +00:00 
			
		
		
		
	fix crash when selecting radar site with new ImGui contexts
This commit is contained in:
		
							parent
							
								
									6d107f6c2d
								
							
						
					
					
						commit
						9bd5af03f9
					
				
					 3 changed files with 7 additions and 1 deletions
				
			
		|  | @ -161,8 +161,12 @@ void DrawLayer::RenderWithoutImGui( | ||||||
| 
 | 
 | ||||||
|    p->textureAtlasBuildCount_ = newTextureAtlasBuildCount; |    p->textureAtlasBuildCount_ = newTextureAtlasBuildCount; | ||||||
| } | } | ||||||
|  | void DrawLayer::ImGuiSelectContext() | ||||||
|  | { | ||||||
|  |    ImGui::SetCurrentContext(p->imGuiContext_); | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
|    void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) | void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) | ||||||
| { | { | ||||||
|    StartImGuiFrame(); |    StartImGuiFrame(); | ||||||
|    RenderWithoutImGui(params); |    RenderWithoutImGui(params); | ||||||
|  |  | ||||||
|  | @ -37,6 +37,7 @@ protected: | ||||||
|    void ImGuiInitialize(); |    void ImGuiInitialize(); | ||||||
|    void |    void | ||||||
|    RenderWithoutImGui(const QMapLibre::CustomLayerRenderParameters& params); |    RenderWithoutImGui(const QMapLibre::CustomLayerRenderParameters& params); | ||||||
|  |    void ImGuiSelectContext(); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|    std::unique_ptr<DrawLayerImpl> p; |    std::unique_ptr<DrawLayerImpl> p; | ||||||
|  |  | ||||||
|  | @ -140,6 +140,7 @@ void RadarSiteLayer::Impl::RenderRadarSite( | ||||||
|       if (ImGui::Button(radarSite->id().c_str())) |       if (ImGui::Button(radarSite->id().c_str())) | ||||||
|       { |       { | ||||||
|          Q_EMIT self_->RadarSiteSelected(radarSite->id()); |          Q_EMIT self_->RadarSiteSelected(radarSite->id()); | ||||||
|  |          self_->ImGuiSelectContext(); | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       // Store hover text for mouse picking pass
 |       // Store hover text for mouse picking pass
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak