mirror of https://github.com/aseprite/aseprite.git
				
				
				
			Fix crash double-clicking a moving selection (fix regression in 7b07f29f0b)
				
					
				
			Here we avoid two ExpandCelCanvas at the same time with MovingPixelsState + DrawingState. Double-clicking inside the selection when we are moving it (MovingPixelsState) could start a new DrawingState which creates a new ToolLoopImpl that needs a new ExpandCelCanvas. So we have to drop the pixels before.
This commit is contained in:
		
							parent
							
								
									7b07f29f0b
								
							
						
					
					
						commit
						9fe05a5dd5
					
				| 
						 | 
					@ -395,6 +395,10 @@ bool StandbyState::onDoubleClick(Editor* editor, MouseMessage* msg)
 | 
				
			||||||
  // Select a tile with double-click
 | 
					  // Select a tile with double-click
 | 
				
			||||||
  if (ink->isSelection() &&
 | 
					  if (ink->isSelection() &&
 | 
				
			||||||
      Preferences::instance().selection.doubleclickSelectTile()) {
 | 
					      Preferences::instance().selection.doubleclickSelectTile()) {
 | 
				
			||||||
 | 
					    // Drop pixels if we are in moving pixels state
 | 
				
			||||||
 | 
					    if (MovingPixelsState* movingPixels = dynamic_cast<MovingPixelsState*>(editor->getState().get()))
 | 
				
			||||||
 | 
					      editor->backToPreviousState();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Start a tool-loop selecting tiles.
 | 
					    // Start a tool-loop selecting tiles.
 | 
				
			||||||
    startDrawingState(editor,
 | 
					    startDrawingState(editor,
 | 
				
			||||||
                      DrawingType::SelectTiles,
 | 
					                      DrawingType::SelectTiles,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue