mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	profile: fix garbled profiles after visiting the planner
See mentioned GitHub issue for the full issue, and images. The reason for this weird behavior is the existence of 2 flags in the profile code: shouldCalculateMaxTime and shouldCalculateMaxDepth. When exactly following the use case and test data as attached to the GitHub issue (a very short dive, shorter than most of the dives in the logbook), the shouldCalculateMaxTime flag never got back to its true status, causing the the time scale not to adapt to other dives when just clicking (or selecting) them from the dive list. The problem is fixed here by also setting the shouldCalculateMaxTime flag on manipulating wayppoints in the dive plan. Fixes: #1039 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
		
							parent
							
								
									082def8162
								
							
						
					
					
						commit
						b4d37e8eeb
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -878,21 +878,21 @@ void ProfileWidget2::mousePressEvent(QMouseEvent *event) | ||||||
| 		return; | 		return; | ||||||
| 	QGraphicsView::mousePressEvent(event); | 	QGraphicsView::mousePressEvent(event); | ||||||
| 	if (currentState == PLAN || currentState == ADD || currentState == EDIT) | 	if (currentState == PLAN || currentState == ADD || currentState == EDIT) | ||||||
| 		shouldCalculateMaxTime = false; | 		shouldCalculateMaxDepth = shouldCalculateMaxTime = false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProfileWidget2::divePlannerHandlerClicked() | void ProfileWidget2::divePlannerHandlerClicked() | ||||||
| { | { | ||||||
| 	if (zoomLevel) | 	if (zoomLevel) | ||||||
| 		return; | 		return; | ||||||
| 	shouldCalculateMaxDepth = false; | 	shouldCalculateMaxDepth = shouldCalculateMaxTime = false; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ProfileWidget2::divePlannerHandlerReleased() | void ProfileWidget2::divePlannerHandlerReleased() | ||||||
| { | { | ||||||
| 	if (zoomLevel) | 	if (zoomLevel) | ||||||
| 		return; | 		return; | ||||||
| 	shouldCalculateMaxDepth = true; | 	shouldCalculateMaxDepth = shouldCalculateMaxTime = true; | ||||||
| 	replot(); | 	replot(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue