Merge pull request #3390 from fufesou/refact/mouse_pos_print_stack
print stack
This commit is contained in:
		
						commit
						bb8c5114b0
					
				| @ -503,8 +503,21 @@ class InputModel { | ||||
|     } | ||||
|     x += d.x; | ||||
|     y += d.y; | ||||
|     var evtX = 0; | ||||
|     var evtY = 0; | ||||
|     try { | ||||
|       evtX = x.round(); | ||||
|       evtY = y.round(); | ||||
|     } catch (e) { | ||||
|       debugPrintStack( | ||||
|           label: 'canvasModel.scale value ${canvasModel.scale}, $e'); | ||||
|       return; | ||||
|     } | ||||
| 
 | ||||
|     if (x < d.x || y < d.y || x > (d.x + d.width) || y > (d.y + d.height)) { | ||||
|     if (evtX < d.x || | ||||
|         evtY < d.y || | ||||
|         evtX > (d.x + d.width) || | ||||
|         evtY > (d.y + d.height)) { | ||||
|       // If left mouse up, no early return. | ||||
|       if (evt['buttons'] != kPrimaryMouseButton || type != 'up') { | ||||
|         return; | ||||
| @ -512,12 +525,12 @@ class InputModel { | ||||
|     } | ||||
| 
 | ||||
|     if (type != '') { | ||||
|       x = 0; | ||||
|       y = 0; | ||||
|       evtX = 0; | ||||
|       evtY = 0; | ||||
|     } | ||||
| 
 | ||||
|     evt['x'] = '${x.round()}'; | ||||
|     evt['y'] = '${y.round()}'; | ||||
|     evt['x'] = '$evtX'; | ||||
|     evt['y'] = '$evtY'; | ||||
|     var buttons = ''; | ||||
|     switch (evt['buttons']) { | ||||
|       case kPrimaryMouseButton: | ||||
|  | ||||
| @ -803,7 +803,9 @@ class CanvasModel with ChangeNotifier { | ||||
|         dyOffset = (y - dh * (y / size.height) - _y).toInt(); | ||||
|       } | ||||
|     } catch (e) { | ||||
|       // Unhandled Exception: Unsupported operation: Infinity or NaN toInt | ||||
|       debugPrintStack( | ||||
|           label: | ||||
|               '(x,y) ($x,$y), (_x,_y) ($_x,$_y), _scale $_scale, display size (${getDisplayWidth()},${getDisplayHeight()}), size $size, , $e'); | ||||
|       return; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user