mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:00:05 +00:00 
			
		
		
		
	Remove unnecessary copy, and make callback argument const in geolines
This commit is contained in:
		
							parent
							
								
									087f6ef310
								
							
						
					
					
						commit
						fea9083f7d
					
				
					 3 changed files with 8 additions and 8 deletions
				
			
		|  | @ -494,7 +494,7 @@ void GeoLines::Impl::UpdateModifiedLineBuffers() | |||
|    for (auto& di : dirtyLines_) | ||||
|    { | ||||
|       // Check if modified line is in the current list
 | ||||
|       if (currentLineList_.size() < di->lineIndex_ || | ||||
|       if (di->lineIndex_ >= currentLineList_.size() || | ||||
|           currentLineList_[di->lineIndex_] != di) | ||||
|       { | ||||
|          continue; | ||||
|  | @ -799,8 +799,7 @@ bool GeoLines::RunMousePicking( | |||
|       } | ||||
|       else if (it->second.di_->hoverCallback_ != nullptr) | ||||
|       { | ||||
|          std::shared_ptr<GeoLineDrawItem> di = it->second.di_; | ||||
|          it->second.di_->hoverCallback_(di, mouseGlobalPos); | ||||
|          it->second.di_->hoverCallback_(it->second.di_, mouseGlobalPos); | ||||
|       } | ||||
| 
 | ||||
|       if (it->second.di_->event_ != nullptr) | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ struct GeoLineDrawItem; | |||
| class GeoLines : public DrawItem | ||||
| { | ||||
| public: | ||||
|    typedef std::function<void(std::shared_ptr<GeoLineDrawItem>&, | ||||
|    typedef std::function<void(const std::shared_ptr<GeoLineDrawItem>&, | ||||
|                               const QPointF&)> | ||||
|       HoverCallback; | ||||
| 
 | ||||
|  |  | |||
|  | @ -159,8 +159,9 @@ public: | |||
|    void ConnectSignals(); | ||||
|    void HandleGeoLinesEvent(std::weak_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|                             QEvent*                                   ev); | ||||
|    void HandleGeoLinesHover(std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|                             const QPointF& mouseGlobalPos); | ||||
|    void | ||||
|    HandleGeoLinesHover(const std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|                        const QPointF& mouseGlobalPos); | ||||
|    void ScheduleRefresh(); | ||||
| 
 | ||||
|    LineData& GetLineData(const std::shared_ptr<const awips::Segment>& segment, | ||||
|  | @ -720,8 +721,8 @@ void AlertLayer::Impl::HandleGeoLinesEvent( | |||
| } | ||||
| 
 | ||||
| void AlertLayer::Impl::HandleGeoLinesHover( | ||||
|    std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|    const QPointF&                              mouseGlobalPos) | ||||
|    const std::shared_ptr<gl::draw::GeoLineDrawItem>& di, | ||||
|    const QPointF&                                    mouseGlobalPos) | ||||
| { | ||||
|    if (di != lastHoverDi_) | ||||
|    { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak