浏览代码

Merge pull request #270 from Unity-Technologies/siyaoH/1.17/fixAndroid

Siyao h/1.17/fix android
/main
GitHub 3 年前
当前提交
e6cedf19
共有 8 个文件被更改,包括 23 次插入26 次删除
  1. 9
      com.unity.uiwidgets/Runtime/material/text_selection.cs
  2. 37
      com.unity.uiwidgets/Runtime/widgets/text_selection.cs
  3. 3
      engine/src/lib/ui/text/paragraph.cc

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) {

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


using Unity.UIWidgets.scheduler;
using Unity.UIWidgets.service;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;
using Object = System.Object;
using Rect = Unity.UIWidgets.ui.Rect;

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)
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(

3
engine/src/lib/ui/text/paragraph.cc


// Then there are boxes.size() groups of 5 which are LTRBD, where D is the
// text direction index.
int size = boxes.size() * 5;
Float32List result = {(float*)malloc(sizeof(float) * size),
(int)boxes.size() * size};
Float32List result = {(float*)malloc(sizeof(float) * size), size};
unsigned long position = 0;
for (unsigned long i = 0; i < boxes.size(); i++) {
const txt::Paragraph::TextBox& box = boxes[i];

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存