mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:30:05 +00:00 
			
		
		
		
	Placefile text animation support
This commit is contained in:
		
							parent
							
								
									e013b9a77f
								
							
						
					
					
						commit
						4cc1a2b310
					
				
					 14 changed files with 89 additions and 1 deletions
				
			
		|  | @ -46,6 +46,8 @@ public: | |||
| 
 | ||||
|    bool thresholded_ {false}; | ||||
| 
 | ||||
|    std::chrono::system_clock::time_point selectedTime_ {}; | ||||
| 
 | ||||
|    std::uint32_t textId_ {}; | ||||
|    glm::vec2     mapScreenCoordLocation_ {}; | ||||
|    float         mapScale_ {1.0f}; | ||||
|  | @ -77,6 +79,12 @@ void PlacefileText::set_placefile_name(const std::string& placefileName) | |||
|    p->placefileName_ = placefileName; | ||||
| } | ||||
| 
 | ||||
| void PlacefileText::set_selected_time( | ||||
|    std::chrono::system_clock::time_point selectedTime) | ||||
| { | ||||
|    p->selectedTime_ = selectedTime; | ||||
| } | ||||
| 
 | ||||
| void PlacefileText::set_thresholded(bool thresholded) | ||||
| { | ||||
|    p->thresholded_ = thresholded; | ||||
|  | @ -117,7 +125,15 @@ void PlacefileText::Impl::RenderTextDrawItem( | |||
|    const QMapLibreGL::CustomLayerRenderParameters&           params, | ||||
|    const std::shared_ptr<const gr::Placefile::TextDrawItem>& di) | ||||
| { | ||||
|    if (!thresholded_ || mapDistance_ <= di->threshold_) | ||||
|    // If no time has been selected, use the current time
 | ||||
|    std::chrono::system_clock::time_point selectedTime = | ||||
|       (selectedTime_ == std::chrono::system_clock::time_point {}) ? | ||||
|          std::chrono::system_clock::now() : | ||||
|          selectedTime_; | ||||
| 
 | ||||
|    if ((!thresholded_ || mapDistance_ <= di->threshold_) && | ||||
|        (di->startTime_ == std::chrono::system_clock::time_point {} || | ||||
|         (di->startTime_ <= selectedTime && selectedTime < di->endTime_))) | ||||
|    { | ||||
|       const auto screenCoordinates = (util::maplibre::LatLongToScreenCoordinate( | ||||
|                                          {di->latitude_, di->longitude_}) - | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat