mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:30:05 +00:00 
			
		
		
		
	Don't add an alert segment twice
This commit is contained in:
		
							parent
							
								
									6097b47b7a
								
							
						
					
					
						commit
						09cdb03699
					
				
					 1 changed files with 23 additions and 6 deletions
				
			
		|  | @ -367,13 +367,30 @@ void AlertLayer::Impl::AddAlert( | ||||||
|    // Take a mutex before modifying lines by segment
 |    // Take a mutex before modifying lines by segment
 | ||||||
|    std::unique_lock lock {linesMutex_}; |    std::unique_lock lock {linesMutex_}; | ||||||
| 
 | 
 | ||||||
|    boost::container::stable_vector<std::shared_ptr<gl::draw::GeoLineDrawItem>>& |    // Add draw items only if the segment has not already been added
 | ||||||
|       drawItems = linesBySegment_[segmentRecord]; |    auto drawItems = linesBySegment_.try_emplace( | ||||||
|  |       segmentRecord, | ||||||
|  |       boost::container::stable_vector< | ||||||
|  |          std::shared_ptr<gl::draw::GeoLineDrawItem>> {}); | ||||||
| 
 | 
 | ||||||
|    AddLines( |    // If draw items were added
 | ||||||
|       geoLines, coordinates, kBlack_, 5.0f, startTime, endTime, drawItems); |    if (drawItems.second) | ||||||
|    AddLines( |    { | ||||||
|       geoLines, coordinates, lineColor, 3.0f, startTime, endTime, drawItems); |       AddLines(geoLines, | ||||||
|  |                coordinates, | ||||||
|  |                kBlack_, | ||||||
|  |                5.0f, | ||||||
|  |                startTime, | ||||||
|  |                endTime, | ||||||
|  |                drawItems.first->second); | ||||||
|  |       AddLines(geoLines, | ||||||
|  |                coordinates, | ||||||
|  |                lineColor, | ||||||
|  |                3.0f, | ||||||
|  |                startTime, | ||||||
|  |                endTime, | ||||||
|  |                drawItems.first->second); | ||||||
|  |    } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void AlertLayer::Impl::UpdateAlert( | void AlertLayer::Impl::UpdateAlert( | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat