textinput 属性lineThrough原理
来源:互联网 发布:网络机房消防应急预案 编辑:程序博客网 时间:2024/04/29 18:07
if (lineThrough || textDecoration == "underline")
{
// FTE doesn't render strikethroughs or underlines,
// but it can tell us where to draw them.
// You can't draw in a TextLine but it can have children,
// so we create a child Shape to draw them in.
var elementFormat:ElementFormat =
TextElement(textBlock.content).elementFormat;
var fontMetrics:FontMetrics;
if (embeddedFontContext)
fontMetrics = embeddedFontContext.callInContext(elementFormat.getFontMetrics, elementFormat, null);
else
fontMetrics = elementFormat.getFontMetrics();
var shape:Shape = new Shape();
var g:Graphics = shape.graphics;
if (lineThrough)
{
g.lineStyle(fontMetrics.strikethroughThickness,
elementFormat.color, elementFormat.alpha);
g.moveTo(0, fontMetrics.strikethroughOffset);
g.lineTo(textLine.textWidth, fontMetrics.strikethroughOffset);
}
if (textDecoration == "underline")
{
g.lineStyle(fontMetrics.underlineThickness,
elementFormat.color, elementFormat.alpha);
g.moveTo(0, fontMetrics.underlineOffset);
g.lineTo(textLine.textWidth, fontMetrics.underlineOffset);
}
textLine.addChild(shape);
}
{
// FTE doesn't render strikethroughs or underlines,
// but it can tell us where to draw them.
// You can't draw in a TextLine but it can have children,
// so we create a child Shape to draw them in.
var elementFormat:ElementFormat =
TextElement(textBlock.content).elementFormat;
var fontMetrics:FontMetrics;
if (embeddedFontContext)
fontMetrics = embeddedFontContext.callInContext(elementFormat.getFontMetrics, elementFormat, null);
else
fontMetrics = elementFormat.getFontMetrics();
var shape:Shape = new Shape();
var g:Graphics = shape.graphics;
if (lineThrough)
{
g.lineStyle(fontMetrics.strikethroughThickness,
elementFormat.color, elementFormat.alpha);
g.moveTo(0, fontMetrics.strikethroughOffset);
g.lineTo(textLine.textWidth, fontMetrics.strikethroughOffset);
}
if (textDecoration == "underline")
{
g.lineStyle(fontMetrics.underlineThickness,
elementFormat.color, elementFormat.alpha);
g.moveTo(0, fontMetrics.underlineOffset);
g.lineTo(textLine.textWidth, fontMetrics.underlineOffset);
}
textLine.addChild(shape);
}
- textinput 属性lineThrough原理
- TextInput
- 解决textinput没有垂直居中的属性
- React-Native TextInput组件的主要属性
- 文本输入框TextInput的属性列表
- [转]FLex组件TextInput比较有用的属性
- Flex中TextInput的“校验”属性restrict(约束,限定)
- React-Native填坑之TextInput value属性
- Flex中如何通过displayAsPassword属性,设置TextInput文本显示密码形式(*)
- Qt qml TextField TextInput等文本输入控件中validator属性的设置
- TextInput详解
- 属性动画 原理
- 自定义textInput errorString 样式
- s:TextInput优化
- DOM3 textInput事件-softbar
- DOM3 textInput事件-softbar
- Flex TextInput获取光标
- 实现TextInput垂直居中
- 【已解决】:win 7 64 bit的机器上装oracle 10 g R2,用 PLsql v8却打不开
- C# 解析URL
- Qt的程序在其他电脑上使用
- POJ 2104(K-th Number-区间第k大-主席树)
- SQL2008不允许保存更改的表结构问题解决方法
- textinput 属性lineThrough原理
- TOmcat启动后报:IOException while loading persisted sessions: java.io.EOFException错误
- Android之adapter详解
- 类所占的内存空间(代码示例)
- OracleDBConsoleorcl无法启动
- 浅析NI LabVIEW数据采集与处理信号的10大优势
- IOS笔记
- 用sp_MSforeachtable快速清除数据库表中的数据
- james:java.net.BindException: Address already in use