print stack
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
17f1c18c92
commit
0a52d64900
@ -503,8 +503,21 @@ class InputModel {
|
||||
}
|
||||
x += d.x;
|
||||
y += d.y;
|
||||
var evtX = 0;
|
||||
var evtY = 0;
|
||||
try {
|
||||
x.round();
|
||||
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