浏览代码

fix text handler

/siyaoH-1.17-fixAndroid
siyao 3 年前
当前提交
6199c1a0
共有 2 个文件被更改,包括 28 次插入33 次删除
  1. 9
      com.unity.uiwidgets/Runtime/material/text_selection.cs
  2. 52
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs

9
com.unity.uiwidgets/Runtime/material/text_selection.cs


}
public override Offset getHandleAnchor(TextSelectionHandleType type, float textLineHeight) {
switch (type) {
case TextSelectionHandleType.left:
return new Offset(MaterialUtils._kHandleSize, 0);
case TextSelectionHandleType.right:
return Offset.zero;
default:
return new Offset(MaterialUtils._kHandleSize / 2, -4);
}
return Offset.zero;
}
new bool canSelectAll(TextSelectionDelegate selectionDelegate) {

52
com.unity.uiwidgets/Runtime/widgets/text_selection.cs


Mathf.Max((interactiveRect.height - handleRect.height) / 2, 0)
);
return new Stack(
children: new List<Widget>() {
new CompositedTransformFollower(
link: layerLink,
offset: interactiveRect.topLeft,
showWhenUnlinked: false,
child: new FadeTransition(
opacity: _opacity,
child: new GestureDetector(
behavior: HitTestBehavior.translucent,
dragStartBehavior: widget.dragStartBehavior,
onPanStart: _handleDragStart,
onPanUpdate: _handleDragUpdate,
onTap: _handleTap,
child: new Padding(
padding: EdgeInsets.only(
left: padding.left,
top: padding.top,
right: padding.right,
bottom: padding.bottom
),
child: widget.selectionControls.buildHandle(context, type,
widget.renderObject.preferredLineHeight)
)
return new CompositedTransformFollower(
link: layerLink,
offset: interactiveRect.topLeft,
showWhenUnlinked: false,
child: new FadeTransition(
opacity: _opacity,
child: new Container(
alignment: Alignment.topLeft,
width: interactiveRect.width,
height: interactiveRect.height,
child: new GestureDetector(
behavior: HitTestBehavior.translucent,
dragStartBehavior: widget.dragStartBehavior,
onPanStart: _handleDragStart,
onPanUpdate: _handleDragUpdate,
onTap: _handleTap,
child: new Padding(
padding: EdgeInsets.only(
left: padding.left,
top: padding.top,
right: padding.right,
bottom: padding.bottom
),
child: widget.selectionControls.buildHandle(context, type,
widget.renderObject.preferredLineHeight)
}
)
}
TextSelectionHandleType _chooseType(

正在加载...
取消
保存