浏览代码

fix minor bugs

/main
xingwei.zhu 6 年前
当前提交
61a6aabc
共有 2 个文件被更改,包括 14 次插入5 次删除
  1. 17
      Runtime/widgets/gesture_detector.cs
  2. 2
      Samples/UIWidgetSample/ScaleGestureSample.cs

17
Runtime/widgets/gesture_detector.cs


bool haveLongPressDrag = onLongPressDragStart != null || onLongPressDragUpdate != null ||
onLongPressDragUp != null;
bool havePan = onPanStart != null || onPanUpdate != null || onPanEnd != null;
if (havePan) {
bool haveScale = onScaleStart != null || onScaleUpdate != null || onScaleEnd != null;
if (havePan || haveScale) {
if (havePan && haveScale) {
throw new UIWidgetsError(
"Incorrect GestureDetector arguments.\n" +
"Having both a pan gesture recognizer and a scale gesture recognizer is redundant; scale is a superset of pan. Just use the scale gesture recognizer."
);
}
string recognizer = havePan ? "pan" : "scale";
"Simultaneously having a vertical drag gesture recognizer, a horizontal drag gesture recognizer, and a pan gesture recognizer " +
"will result in the pan gesture recognizer being ignored, since the other two will catch all drags."
$"Simultaneously having a vertical drag gesture recognizer, a horizontal drag gesture recognizer, and a {recognizer} gesture recognizer " +
$"will result in the {recognizer} gesture recognizer being ignored, since the other two will catch all drags."
if (haveLongPress && haveLongPressDrag) {
throw new UIWidgetsError(
"Incorrect GestureDetector arguments.\n" +

2
Samples/UIWidgetSample/ScaleGestureSample.cs


}
}
class ScaleGesturePanelState : State<HoverMainPanel> {
class ScaleGesturePanelState : State<ScaleGesturePanel> {
float scaleValue = 1.0f;
public override Widget build(BuildContext context) {

正在加载...
取消
保存