fzhangtj 6 年前
当前提交
f708e9e7
共有 6 个文件被更改,包括 5 次插入8 次删除
  1. 2
      Assets/UIWidgets/Tests/EditableTextWiget.cs
  2. 2
      Assets/UIWidgets/painting/text_painter.cs
  3. 4
      Assets/UIWidgets/service/text_input.cs
  4. 1
      Assets/UIWidgets/ui/painting/txt/font_manager.cs
  5. 1
      Assets/UIWidgets/ui/txt/paragraph.cs
  6. 3
      Assets/UIWidgets/widgets/editable_text.cs

2
Assets/UIWidgets/Tests/EditableTextWiget.cs


this.windowAdapter.attachRootWidget(root);
this.titleContent = new GUIContent("EditableTextWiget");
}
void OnDestroy() {
this.windowAdapter = null;
}

2
Assets/UIWidgets/painting/text_painter.cs


{
Debug.Assert(text != null, "TextPainter.text must be set to a non-null value before using the TextPainter.");
Debug.Assert(textDirection != null, "TextPainter.textDirection must be set to a non-null value before using the TextPainter.");
if (!_needsLayout && minWidth == _lastMaxWidth && maxWidth == _lastMaxWidth)
if (!_needsLayout && minWidth == _lastMinWidth && maxWidth == _lastMaxWidth)
{
return;
}

4
Assets/UIWidgets/service/text_input.cs


public TextEditingValue compose(string composeText)
{
D.assert(string.IsNullOrEmpty(composeText));
D.assert(!string.IsNullOrEmpty(composeText));
var composeStart = composing == TextRange.empty ? selection.start : composing.start;
var lastComposeEnd =composing == TextRange.empty ? selection.end : composing.end;
var newText = text.Substring(0, composeStart) + composeText + text.Substring(lastComposeEnd);

TextEditingValue performOperation(TextEditOp operation)
{
// m_RevealCursor = true;
TextEditingValue newValue = null;
switch (operation)
{
case TextEditOp.MoveLeft:

1
Assets/UIWidgets/ui/painting/txt/font_manager.cs


return founded;
}
Debug.Log(string.Format("Create new Font names={0}, size={1}", names, fontSize));
var newFont = Font.CreateDynamicFontFromOSFont(names,
fontSize);
_fonts.Add(newFont);

1
Assets/UIWidgets/ui/txt/paragraph.cs


using System;
using System.Collections.Generic;
using UIWidgets.painting;
using UIWidgets.ui.txt;
using UnityEngine;

3
Assets/UIWidgets/widgets/editable_text.cs


this.maxLines = maxLines;
this.selectionColor = selectionColor;
this.textScaleFactor = textScaleFactor;
this.textAlign = textAlign;
this.textDirection = textDirection;
this.obscureText = obscureText;
this.autocorrect = autocorrect;

ignorePointer: rendererIgnoresPointer
);
}
public override void updateRenderObject(BuildContext context, RenderObject renderObject)
{
var edit = (RenderEditable) renderObject;

正在加载...
取消
保存