@next2d/text 1.18.11 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -18
- package/src/TextArea/service/TextAreaMovePositionService.d.ts +11 -0
- package/src/TextArea/service/TextAreaMovePositionService.js +42 -0
- package/src/TextArea/usecase/TextAreaCompositionEndUseCase.d.ts +9 -0
- package/src/TextArea/usecase/TextAreaCompositionEndUseCase.js +17 -0
- package/src/TextArea/usecase/TextAreaCompositionStartUseCase.d.ts +9 -0
- package/src/TextArea/usecase/TextAreaCompositionStartUseCase.js +17 -0
- package/src/TextArea/usecase/TextAreaCompositionUpdateUseCase.d.ts +10 -0
- package/src/TextArea/usecase/TextAreaCompositionUpdateUseCase.js +18 -0
- package/src/TextArea/usecase/TextAreaInputUseCase.d.ts +10 -0
- package/src/TextArea/usecase/TextAreaInputUseCase.js +25 -0
- package/src/TextArea/usecase/TextAreaRegisterEventUseCase.d.ts +10 -0
- package/src/TextArea/usecase/TextAreaRegisterEventUseCase.js +21 -0
- package/src/TextData.d.ts +103 -0
- package/src/TextData.js +183 -0
- package/src/TextField/service/TextFieldApplyChangesService.d.ts +11 -0
- package/src/TextField/service/TextFieldApplyChangesService.js +16 -0
- package/src/TextField/service/TextFieldBlinkingClearTimeoutService.d.ts +9 -0
- package/src/TextField/service/TextFieldBlinkingClearTimeoutService.js +16 -0
- package/src/TextField/service/TextFieldCompositionStartService.d.ts +11 -0
- package/src/TextField/service/TextFieldCompositionStartService.js +12 -0
- package/src/TextField/service/TextFieldPasteService.d.ts +11 -0
- package/src/TextField/service/TextFieldPasteService.js +16 -0
- package/src/TextField/usecase/TextFieldArrowDownUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldArrowDownUseCase.js +191 -0
- package/src/TextField/usecase/TextFieldArrowLeftUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldArrowLeftUseCase.js +98 -0
- package/src/TextField/usecase/TextFieldArrowRightUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldArrowRightUseCase.js +92 -0
- package/src/TextField/usecase/TextFieldArrowUpUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldArrowUpUseCase.js +156 -0
- package/src/TextField/usecase/TextFieldBlinkingUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldBlinkingUseCase.js +21 -0
- package/src/TextField/usecase/TextFieldBuildFromCharacterUseCase.d.ts +13 -0
- package/src/TextField/usecase/TextFieldBuildFromCharacterUseCase.js +58 -0
- package/src/TextField/usecase/TextFieldCompositionEndUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldCompositionEndUseCase.js +32 -0
- package/src/TextField/usecase/TextFieldCompositionUpdateUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldCompositionUpdateUseCase.js +109 -0
- package/src/TextField/usecase/TextFieldCopyUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldCopyUseCase.js +38 -0
- package/src/TextField/usecase/TextFieldDeleteTextUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldDeleteTextUseCase.js +108 -0
- package/src/TextField/usecase/TextFieldGetLineTextUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldGetLineTextUseCase.js +32 -0
- package/src/TextField/usecase/TextFieldGetTextDataUseCase.d.ts +15 -0
- package/src/TextField/usecase/TextFieldGetTextDataUseCase.js +26 -0
- package/src/TextField/usecase/TextFieldHtmlTextToRawTextUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldHtmlTextToRawTextUseCase.js +31 -0
- package/src/TextField/usecase/TextFieldInsertTextUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldInsertTextUseCase.js +79 -0
- package/src/TextField/usecase/TextFieldKeyDownEventUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldKeyDownEventUseCase.js +60 -0
- package/src/TextField/usecase/TextFieldReloadUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldReloadUseCase.js +25 -0
- package/src/TextField/usecase/TextFieldReplaceTextUseCase.d.ts +14 -0
- package/src/TextField/usecase/TextFieldReplaceTextUseCase.js +24 -0
- package/src/TextField/usecase/TextFieldResetUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldResetUseCase.js +20 -0
- package/src/TextField/usecase/TextFieldResizeAutoFontSizeUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldResizeAutoFontSizeUseCase.js +37 -0
- package/src/TextField/usecase/TextFieldResizeUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldResizeUseCase.js +49 -0
- package/src/TextField/usecase/TextFieldSelectAllUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldSelectAllUseCase.js +20 -0
- package/src/TextField/usecase/TextFieldSelectedFocusMoveUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldSelectedFocusMoveUseCase.js +90 -0
- package/src/TextField/usecase/TextFieldSetFocusIndexUseCase.d.ts +14 -0
- package/src/TextField/usecase/TextFieldSetFocusIndexUseCase.js +197 -0
- package/src/TextField/usecase/TextFieldSetFocusUseCase.d.ts +11 -0
- package/src/TextField/usecase/TextFieldSetFocusUseCase.js +43 -0
- package/src/TextField/usecase/TextFieldSetScrollXUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldSetScrollXUseCase.js +66 -0
- package/src/TextField/usecase/TextFieldSetScrollYUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldSetScrollYUseCase.js +66 -0
- package/src/TextField/usecase/TextFieldUpdateStopIndexUseCase.d.ts +12 -0
- package/src/TextField/usecase/TextFieldUpdateStopIndexUseCase.js +82 -0
- package/src/TextField.d.ts +602 -0
- package/src/TextField.js +1292 -0
- package/src/TextFormat/service/TextFormatGenerateFontStyleService.d.ts +11 -0
- package/src/TextFormat/service/TextFormatGenerateFontStyleService.js +19 -0
- package/src/TextFormat/service/TextFormatGetWidthMarginService.d.ts +11 -0
- package/src/TextFormat/service/TextFormatGetWidthMarginService.js +19 -0
- package/src/TextFormat/service/TextFormatHtmlTextGenerateStyleService.d.ts +11 -0
- package/src/TextFormat/service/TextFormatHtmlTextGenerateStyleService.js +51 -0
- package/src/TextFormat/service/TextFormatIsSameService.d.ts +12 -0
- package/src/TextFormat/service/TextFormatIsSameService.js +28 -0
- package/src/TextFormat/service/TextFormatSetDefaultService.d.ts +11 -0
- package/src/TextFormat/service/TextFormatSetDefaultService.js +22 -0
- package/{dist → src}/TextFormat.d.ts +42 -128
- package/src/TextFormat.js +233 -0
- package/src/TextParser/service/TextParserAdjustmentHeightService.d.ts +11 -0
- package/src/TextParser/service/TextParserAdjustmentHeightService.js +24 -0
- package/src/TextParser/service/TextParserParseStyleService.d.ts +11 -0
- package/src/TextParser/service/TextParserParseStyleService.js +80 -0
- package/src/TextParser/usecase/TextParserCreateNewLineUseCase.d.ts +13 -0
- package/src/TextParser/usecase/TextParserCreateNewLineUseCase.js +35 -0
- package/src/TextParser/usecase/TextParserParseHtmlTextUseCase.d.ts +15 -0
- package/src/TextParser/usecase/TextParserParseHtmlTextUseCase.js +37 -0
- package/src/TextParser/usecase/TextParserParseTagUseCase.d.ts +17 -0
- package/src/TextParser/usecase/TextParserParseTagUseCase.js +57 -0
- package/src/TextParser/usecase/TextParserParseTextUseCase.d.ts +16 -0
- package/src/TextParser/usecase/TextParserParseTextUseCase.js +140 -0
- package/src/TextParser/usecase/TextParserSetAttributesUseCase.d.ts +14 -0
- package/src/TextParser/usecase/TextParserSetAttributesUseCase.js +63 -0
- package/src/TextUtil.d.ts +114 -0
- package/src/TextUtil.js +186 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/interface/IAttributeObject.d.ts +4 -0
- package/src/interface/IBlendMode.d.ts +1 -0
- package/src/interface/IBounds.d.ts +6 -0
- package/src/interface/ICharacter.d.ts +5 -0
- package/src/interface/ICharacter.js +1 -0
- package/src/interface/IDictionaryTag.d.ts +8 -0
- package/src/interface/IDictionaryTag.js +1 -0
- package/src/interface/IElementPosition.d.ts +4 -0
- package/src/interface/IElementPosition.js +1 -0
- package/src/interface/IFilterArray.d.ts +2 -0
- package/src/interface/IFilterArray.js +1 -0
- package/src/interface/IGrid.d.ts +6 -0
- package/src/interface/IGrid.js +1 -0
- package/src/interface/ILoopConfig.d.ts +8 -0
- package/src/interface/ILoopConfig.js +1 -0
- package/src/interface/ILoopType.d.ts +1 -0
- package/src/interface/ILoopType.js +1 -0
- package/src/interface/IMovieClipActionObject.d.ts +5 -0
- package/src/interface/IMovieClipActionObject.js +1 -0
- package/src/interface/IMovieClipCharacter.d.ts +17 -0
- package/src/interface/IMovieClipCharacter.js +1 -0
- package/src/interface/IMovieClipLabelObject.d.ts +4 -0
- package/src/interface/IMovieClipLabelObject.js +1 -0
- package/src/interface/IMovieClipSoundObject.d.ts +5 -0
- package/src/interface/IMovieClipSoundObject.js +1 -0
- package/src/interface/IOptions.d.ts +8 -0
- package/src/interface/IOptions.js +1 -0
- package/src/interface/IPlaceObject.d.ts +14 -0
- package/src/interface/IPlaceObject.js +1 -0
- package/src/interface/IRGBA.d.ts +6 -0
- package/src/interface/IRGBA.js +1 -0
- package/src/interface/IShapeCharacter.d.ts +14 -0
- package/src/interface/IShapeCharacter.js +1 -0
- package/src/interface/ISoundTag.d.ts +6 -0
- package/src/interface/ISoundTag.js +1 -0
- package/src/interface/ISurfaceFilter.d.ts +6 -0
- package/src/interface/ISurfaceFilter.js +1 -0
- package/src/interface/ITextFieldAutoSize.d.ts +1 -0
- package/src/interface/ITextFieldAutoSize.js +1 -0
- package/src/interface/ITextFieldCharacter copy.d.ts +26 -0
- package/src/interface/ITextFieldCharacter copy.js +1 -0
- package/src/interface/ITextFieldCharacter.d.ts +26 -0
- package/src/interface/ITextFieldCharacter.js +1 -0
- package/src/interface/ITextFieldType copy.d.ts +1 -0
- package/src/interface/ITextFieldType copy.js +1 -0
- package/src/interface/ITextFieldType.d.ts +1 -0
- package/src/interface/ITextFieldType.js +1 -0
- package/src/interface/ITextFormatAlign copy.d.ts +1 -0
- package/src/interface/ITextFormatAlign copy.js +1 -0
- package/src/interface/ITextFormatAlign.d.ts +1 -0
- package/src/interface/ITextFormatAlign.js +1 -0
- package/src/interface/ITextFormatObject.d.ts +14 -0
- package/src/interface/ITextFormatObject.js +1 -0
- package/src/interface/ITextObject.d.ts +12 -0
- package/src/interface/ITextObject.js +1 -0
- package/src/interface/ITextObjectMode.d.ts +1 -0
- package/src/interface/ITextObjectMode.js +1 -0
- package/src/interface/IVideoCharacter.d.ts +11 -0
- package/src/interface/IVideoCharacter.js +1 -0
- package/dist/TextData.d.ts +0 -74
- package/dist/TextData.js +0 -132
- package/dist/TextFormat.js +0 -493
- package/dist/TextParser.d.ts +0 -23
- package/dist/TextParser.js +0 -459
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/interface/OptionsImpl.d.ts +0 -8
- package/dist/interface/TextObjectImpl.d.ts +0 -12
- package/dist/interface/TextObjectModeImpl.d.ts +0 -1
- /package/{dist/interface/OptionsImpl.js → src/interface/IAttributeObject.js} +0 -0
- /package/{dist/interface/TextObjectImpl.js → src/interface/IBlendMode.js} +0 -0
- /package/{dist/interface/TextObjectModeImpl.js → src/interface/IBounds.js} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { execute as textFieldGetTextDataUseCase } from "../../TextField/usecase/TextFieldGetTextDataUseCase";
|
|
2
|
+
import { execute as textFieldBlinkingClearTimeoutService } from "../../TextField/service/TextFieldBlinkingClearTimeoutService";
|
|
3
|
+
import { execute as textFieldBlinkingUseCase } from "../../TextField/usecase/TextFieldBlinkingUseCase";
|
|
4
|
+
/**
|
|
5
|
+
* @description テキストフィールドのフォーカスインデックスを下に移動します。
|
|
6
|
+
* Moves the focus index of the text field down.
|
|
7
|
+
*
|
|
8
|
+
* @param {TextField} text_field
|
|
9
|
+
* @param {boolean} shift_key
|
|
10
|
+
* @return {void}
|
|
11
|
+
* @method
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
export const execute = (text_field, shift_key) => {
|
|
15
|
+
if (text_field.focusIndex === -1) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const textData = textFieldGetTextDataUseCase(text_field);
|
|
19
|
+
if (2 > textData.textTable.length) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const textObject = textData.textTable[text_field.focusIndex];
|
|
23
|
+
if (!textObject) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const line = textObject.mode === "text"
|
|
27
|
+
? textObject.line
|
|
28
|
+
: textObject.line - 1;
|
|
29
|
+
// 最終行の場合は、フォーカスインデックスを最終位置に設定
|
|
30
|
+
if (line === textData.lineTable.length - 1) {
|
|
31
|
+
if (!shift_key) {
|
|
32
|
+
text_field.selectIndex = -1;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (text_field.selectIndex === -1) {
|
|
36
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
40
|
+
text_field.selectIndex = -1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
text_field.focusVisible = false;
|
|
45
|
+
text_field.focusIndex = textData.textTable.length;
|
|
46
|
+
const width = text_field.width;
|
|
47
|
+
const scaleX = (text_field.textWidth - width) / width;
|
|
48
|
+
let scrollX = 0;
|
|
49
|
+
for (let idx = 1; text_field.focusIndex >= idx; ++idx) {
|
|
50
|
+
const textObject = textData.textTable[idx];
|
|
51
|
+
if (!textObject || textObject.line > line) {
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
if (textObject.line !== line) {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
scrollX += textObject.w;
|
|
58
|
+
}
|
|
59
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
60
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
61
|
+
}
|
|
62
|
+
text_field.scrollX = (scrollX - width) / scaleX;
|
|
63
|
+
textFieldBlinkingClearTimeoutService();
|
|
64
|
+
textFieldBlinkingUseCase(text_field);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const height = text_field.height;
|
|
68
|
+
const scaleY = (text_field.textHeight - height) / height;
|
|
69
|
+
let currentHeight = -text_field.scrollY * scaleY - 2;
|
|
70
|
+
let endLine = 0;
|
|
71
|
+
for (let idx = 0; idx < textData.heightTable.length; ++idx) {
|
|
72
|
+
currentHeight += textData.heightTable[idx];
|
|
73
|
+
if (currentHeight > height) {
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
endLine++;
|
|
77
|
+
}
|
|
78
|
+
let currentWidth = 2;
|
|
79
|
+
for (let idx = 1; idx < textData.textTable.length; ++idx) {
|
|
80
|
+
const textObject = textData.textTable[idx];
|
|
81
|
+
if (!textObject) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (text_field.focusIndex === idx) {
|
|
85
|
+
if (textObject.mode === "text") {
|
|
86
|
+
currentWidth += textObject.w / 2;
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
if (textObject.line > line) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (textObject.line !== line || textObject.mode !== "text") {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
currentWidth += textObject.w;
|
|
97
|
+
}
|
|
98
|
+
let textWidth = 2;
|
|
99
|
+
const targetLine = line + 1;
|
|
100
|
+
for (let idx = 1; idx < textData.textTable.length; ++idx) {
|
|
101
|
+
const textObject = textData.textTable[idx];
|
|
102
|
+
if (!textObject) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (textObject.line > targetLine) {
|
|
106
|
+
if (!shift_key) {
|
|
107
|
+
text_field.selectIndex = -1;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (text_field.selectIndex === -1) {
|
|
111
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
115
|
+
text_field.selectIndex = -1;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (textObject.line >= endLine) {
|
|
120
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
121
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
122
|
+
}
|
|
123
|
+
text_field.scrollY += textData.heightTable[textObject.line] / scaleY;
|
|
124
|
+
}
|
|
125
|
+
text_field.focusVisible = false;
|
|
126
|
+
text_field.focusIndex = textObject.mode === "text" ? idx - 1 : idx;
|
|
127
|
+
if (text_field.scrollX && textWidth < currentWidth) {
|
|
128
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
129
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
130
|
+
}
|
|
131
|
+
text_field.scrollX = text_field.width * ((textWidth - 2) / text_field.textWidth);
|
|
132
|
+
}
|
|
133
|
+
textFieldBlinkingClearTimeoutService();
|
|
134
|
+
textFieldBlinkingUseCase(text_field);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (textObject.line !== targetLine || textObject.mode !== "text") {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
textWidth += textObject.w;
|
|
141
|
+
if (textWidth > currentWidth) {
|
|
142
|
+
if (!shift_key) {
|
|
143
|
+
text_field.selectIndex = -1;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
if (text_field.selectIndex === -1) {
|
|
147
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (text_field.selectIndex === idx - 1) {
|
|
151
|
+
text_field.selectIndex = -1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (textObject.line >= endLine) {
|
|
156
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
157
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
158
|
+
}
|
|
159
|
+
text_field.scrollY += textData.heightTable[textObject.line] / scaleY;
|
|
160
|
+
}
|
|
161
|
+
if (text_field.scrollX) {
|
|
162
|
+
const width = text_field.width;
|
|
163
|
+
const scaleX = (text_field.textWidth - width) / width;
|
|
164
|
+
const scrollWidth = text_field.scrollX * scaleX - 2;
|
|
165
|
+
if (scrollWidth > textWidth) {
|
|
166
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
167
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
168
|
+
}
|
|
169
|
+
text_field.scrollX = text_field.width * ((textWidth - 2) / text_field.textWidth);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
text_field.focusVisible = false;
|
|
173
|
+
text_field.focusIndex = idx;
|
|
174
|
+
textFieldBlinkingClearTimeoutService();
|
|
175
|
+
textFieldBlinkingUseCase(text_field);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (!shift_key) {
|
|
180
|
+
text_field.selectIndex = -1;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
if (text_field.selectIndex === -1) {
|
|
184
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
text_field.focusVisible = false;
|
|
188
|
+
text_field.focusIndex = textData.textTable.length;
|
|
189
|
+
textFieldBlinkingClearTimeoutService();
|
|
190
|
+
textFieldBlinkingUseCase(text_field);
|
|
191
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TextField } from "../../TextField";
|
|
2
|
+
/**
|
|
3
|
+
* @description テキストフィールドのフォーカスインデックスを左に移動します。
|
|
4
|
+
* Moves the focus index of the text field to the left.
|
|
5
|
+
*
|
|
6
|
+
* @param {TextField} text_field
|
|
7
|
+
* @param {boolean} shift_key
|
|
8
|
+
* @return {void}
|
|
9
|
+
* @method
|
|
10
|
+
* @protected
|
|
11
|
+
*/
|
|
12
|
+
export declare const execute: (text_field: TextField, shift_key: boolean) => void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { execute as textFieldGetTextDataUseCase } from "../../TextField/usecase/TextFieldGetTextDataUseCase";
|
|
2
|
+
import { execute as textFieldBlinkingClearTimeoutService } from "../../TextField/service/TextFieldBlinkingClearTimeoutService";
|
|
3
|
+
import { execute as textFieldBlinkingUseCase } from "../../TextField/usecase/TextFieldBlinkingUseCase";
|
|
4
|
+
/**
|
|
5
|
+
* @description テキストフィールドのフォーカスインデックスを左に移動します。
|
|
6
|
+
* Moves the focus index of the text field to the left.
|
|
7
|
+
*
|
|
8
|
+
* @param {TextField} text_field
|
|
9
|
+
* @param {boolean} shift_key
|
|
10
|
+
* @return {void}
|
|
11
|
+
* @method
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
export const execute = (text_field, shift_key) => {
|
|
15
|
+
if (!text_field.focusIndex) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const textData = textFieldGetTextDataUseCase(text_field);
|
|
19
|
+
if (textData.textTable.length && text_field.focusIndex < 2) {
|
|
20
|
+
text_field.focusIndex = 1;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// fixed logic
|
|
24
|
+
text_field.focusIndex--;
|
|
25
|
+
if (!shift_key) {
|
|
26
|
+
text_field.selectIndex = -1;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if (text_field.selectIndex === -1) {
|
|
30
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
34
|
+
text_field.selectIndex = -1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const textObject = textData.textTable[text_field.focusIndex];
|
|
39
|
+
if (textObject) {
|
|
40
|
+
const line = textObject.mode === "text"
|
|
41
|
+
? textObject.line
|
|
42
|
+
: textObject.line - 1;
|
|
43
|
+
const height = text_field.height;
|
|
44
|
+
const scaleY = (text_field.textHeight - height) / height;
|
|
45
|
+
let currentHeight = -text_field.scrollY * scaleY - 2;
|
|
46
|
+
let startLine = 0;
|
|
47
|
+
for (let idx = 0; idx < textData.heightTable.length; ++idx) {
|
|
48
|
+
currentHeight += textData.heightTable[idx];
|
|
49
|
+
if (currentHeight > 0) {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
startLine++;
|
|
53
|
+
}
|
|
54
|
+
if (startLine > line) {
|
|
55
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
56
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
57
|
+
}
|
|
58
|
+
text_field.scrollY -= textData.heightTable[textObject.line] / scaleY;
|
|
59
|
+
}
|
|
60
|
+
const currentTextObject = textData.textTable[text_field.focusIndex + 1];
|
|
61
|
+
if (currentTextObject) {
|
|
62
|
+
const currentLine = currentTextObject.mode === "text"
|
|
63
|
+
? currentTextObject.line
|
|
64
|
+
: currentTextObject.line - 1;
|
|
65
|
+
let textWidth = 2;
|
|
66
|
+
for (let idx = 1; text_field.focusIndex > idx; ++idx) {
|
|
67
|
+
const textObject = textData.textTable[idx];
|
|
68
|
+
if (!textObject || textObject.line > line) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
if (textObject.line !== line) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
textWidth += textObject.w;
|
|
75
|
+
}
|
|
76
|
+
const width = text_field.width;
|
|
77
|
+
const scaleX = (text_field.textWidth - width) / width;
|
|
78
|
+
const scrollWidth = text_field.scrollX * scaleX - 2;
|
|
79
|
+
if (textWidth > width && currentTextObject && line < currentLine) {
|
|
80
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
81
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
82
|
+
}
|
|
83
|
+
text_field.scrollX = text_field.width;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (scrollWidth > textWidth) {
|
|
87
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
88
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
89
|
+
}
|
|
90
|
+
text_field.scrollX = text_field.width * ((textWidth - 2) / text_field.textWidth);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
text_field.focusVisible = false;
|
|
96
|
+
textFieldBlinkingClearTimeoutService();
|
|
97
|
+
textFieldBlinkingUseCase(text_field);
|
|
98
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TextField } from "../../TextField";
|
|
2
|
+
/**
|
|
3
|
+
* @description テキストフィールドのフォーカス位置を右に移動します。
|
|
4
|
+
* Moves the focus position of the text field to the right.
|
|
5
|
+
*
|
|
6
|
+
* @param {TextField} text_field
|
|
7
|
+
* @param {boolean} shift_key
|
|
8
|
+
* @return {void}
|
|
9
|
+
* @method
|
|
10
|
+
* @protected
|
|
11
|
+
*/
|
|
12
|
+
export declare const execute: (text_field: TextField, shift_key: boolean) => void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { execute as textFieldGetTextDataUseCase } from "../../TextField/usecase/TextFieldGetTextDataUseCase";
|
|
2
|
+
import { execute as textFieldBlinkingClearTimeoutService } from "../../TextField/service/TextFieldBlinkingClearTimeoutService";
|
|
3
|
+
import { execute as textFieldBlinkingUseCase } from "../../TextField/usecase/TextFieldBlinkingUseCase";
|
|
4
|
+
/**
|
|
5
|
+
* @description テキストフィールドのフォーカス位置を右に移動します。
|
|
6
|
+
* Moves the focus position of the text field to the right.
|
|
7
|
+
*
|
|
8
|
+
* @param {TextField} text_field
|
|
9
|
+
* @param {boolean} shift_key
|
|
10
|
+
* @return {void}
|
|
11
|
+
* @method
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
export const execute = (text_field, shift_key) => {
|
|
15
|
+
const textData = textFieldGetTextDataUseCase(text_field);
|
|
16
|
+
if (textData.textTable.length === text_field.focusIndex) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (!shift_key) {
|
|
20
|
+
text_field.selectIndex = -1;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
if (text_field.selectIndex === -1) {
|
|
24
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
28
|
+
text_field.selectIndex = -1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// fixed logic
|
|
33
|
+
text_field.focusVisible = false;
|
|
34
|
+
text_field.focusIndex++;
|
|
35
|
+
textFieldBlinkingClearTimeoutService();
|
|
36
|
+
textFieldBlinkingUseCase(text_field);
|
|
37
|
+
const textObject = textData.textTable[text_field.focusIndex];
|
|
38
|
+
if (textObject) {
|
|
39
|
+
const line = textObject.mode === "text"
|
|
40
|
+
? textObject.line
|
|
41
|
+
: textObject.line - 1;
|
|
42
|
+
const height = text_field.height;
|
|
43
|
+
const scaleY = (text_field.textHeight - height) / height;
|
|
44
|
+
let currentHeight = -text_field.scrollY * scaleY - 2;
|
|
45
|
+
let endLine = 0;
|
|
46
|
+
for (let idx = 0; idx < textData.heightTable.length; ++idx) {
|
|
47
|
+
currentHeight += textData.heightTable[idx];
|
|
48
|
+
if (currentHeight > height) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
endLine++;
|
|
52
|
+
}
|
|
53
|
+
if (line >= endLine) {
|
|
54
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
55
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
56
|
+
}
|
|
57
|
+
text_field.scrollY += textData.heightTable[line] / scaleY;
|
|
58
|
+
}
|
|
59
|
+
const currentTextObject = textData.textTable[text_field.focusIndex - 1];
|
|
60
|
+
const currentLine = currentTextObject.mode === "text"
|
|
61
|
+
? currentTextObject.line
|
|
62
|
+
: currentTextObject.line - 1;
|
|
63
|
+
if (currentTextObject && line > currentLine) {
|
|
64
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
65
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
66
|
+
}
|
|
67
|
+
text_field.scrollX = 0;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const width = text_field.width;
|
|
71
|
+
const scaleX = (text_field.textWidth - width) / width;
|
|
72
|
+
let limitWidth = text_field.scrollX * scaleX - 2 + width;
|
|
73
|
+
for (let idx = 1; text_field.focusIndex >= idx; ++idx) {
|
|
74
|
+
const textObject = textData.textTable[idx];
|
|
75
|
+
if (!textObject || textObject.line > line) {
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
if (textObject.line !== line) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
limitWidth -= textObject.w;
|
|
82
|
+
if (limitWidth > 0) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
86
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
87
|
+
}
|
|
88
|
+
text_field.scrollX += textObject.w / scaleX;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TextField } from "../../TextField";
|
|
2
|
+
/**
|
|
3
|
+
* @description テキストフィールドのフォーカスインデックスを上に移動します。
|
|
4
|
+
* Moves the focus index of the text field up.
|
|
5
|
+
*
|
|
6
|
+
* @param {TextField} text_field
|
|
7
|
+
* @param {boolean} shift_key
|
|
8
|
+
* @return {void}
|
|
9
|
+
* @method
|
|
10
|
+
* @protected
|
|
11
|
+
*/
|
|
12
|
+
export declare const execute: (text_field: TextField, shift_key: boolean) => void;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { execute as textFieldGetTextDataUseCase } from "../../TextField/usecase/TextFieldGetTextDataUseCase";
|
|
2
|
+
import { execute as textFieldBlinkingClearTimeoutService } from "../../TextField/service/TextFieldBlinkingClearTimeoutService";
|
|
3
|
+
import { execute as textFieldBlinkingUseCase } from "../../TextField/usecase/TextFieldBlinkingUseCase";
|
|
4
|
+
/**
|
|
5
|
+
* @description テキストフィールドのフォーカスインデックスを上に移動します。
|
|
6
|
+
* Moves the focus index of the text field up.
|
|
7
|
+
*
|
|
8
|
+
* @param {TextField} text_field
|
|
9
|
+
* @param {boolean} shift_key
|
|
10
|
+
* @return {void}
|
|
11
|
+
* @method
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
export const execute = (text_field, shift_key) => {
|
|
15
|
+
if (text_field.focusIndex === -1) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const textData = textFieldGetTextDataUseCase(text_field);
|
|
19
|
+
if (2 > textData.textTable.length) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const index = textData.textTable.length === text_field.focusIndex
|
|
23
|
+
? text_field.focusIndex - 1
|
|
24
|
+
: text_field.focusIndex;
|
|
25
|
+
const textObject = textData.textTable[index];
|
|
26
|
+
if (!textObject || !textObject.line) {
|
|
27
|
+
if (!shift_key) {
|
|
28
|
+
text_field.selectIndex = -1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (text_field.selectIndex === -1) {
|
|
32
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
36
|
+
text_field.selectIndex = -1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
41
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
42
|
+
}
|
|
43
|
+
text_field.focusVisible = false;
|
|
44
|
+
text_field.focusIndex = 1;
|
|
45
|
+
text_field.scrollX = 0;
|
|
46
|
+
textFieldBlinkingClearTimeoutService();
|
|
47
|
+
textFieldBlinkingUseCase(text_field);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const line = textObject.mode === "text"
|
|
51
|
+
? textObject.line
|
|
52
|
+
: textObject.line - 1;
|
|
53
|
+
const height = text_field.height;
|
|
54
|
+
const scaleY = (text_field.textHeight - height) / height;
|
|
55
|
+
let startLine = 0;
|
|
56
|
+
let currentHeight = -text_field.scrollY * scaleY - 2;
|
|
57
|
+
for (let idx = 0; idx < textData.heightTable.length; ++idx) {
|
|
58
|
+
currentHeight += textData.heightTable[idx];
|
|
59
|
+
if (currentHeight > 0) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
startLine++;
|
|
63
|
+
}
|
|
64
|
+
let currentWidth = 2;
|
|
65
|
+
for (let idx = 1; idx < textData.textTable.length; ++idx) {
|
|
66
|
+
const textObject = textData.textTable[idx];
|
|
67
|
+
if (!textObject) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (text_field.focusIndex === idx) {
|
|
71
|
+
if (textObject.mode === "text") {
|
|
72
|
+
currentWidth += textObject.w / 2;
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (textObject.line > line) {
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
if (textObject.line !== line || textObject.mode !== "text") {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
currentWidth += textObject.w;
|
|
83
|
+
}
|
|
84
|
+
let textWidth = 2;
|
|
85
|
+
const targetLine = line - 1;
|
|
86
|
+
for (let idx = 1; idx < textData.textTable.length; ++idx) {
|
|
87
|
+
const textObject = textData.textTable[idx];
|
|
88
|
+
if (!textObject) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (textObject.line > targetLine) {
|
|
92
|
+
if (!shift_key) {
|
|
93
|
+
text_field.selectIndex = -1;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
if (text_field.selectIndex === -1) {
|
|
97
|
+
text_field.selectIndex = text_field.focusIndex;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (text_field.selectIndex === text_field.focusIndex) {
|
|
101
|
+
text_field.selectIndex = -1;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (startLine >= textObject.line) {
|
|
106
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
107
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
108
|
+
}
|
|
109
|
+
text_field.scrollY -= textData.heightTable[textObject.line] / scaleY;
|
|
110
|
+
}
|
|
111
|
+
if (text_field.scrollX) {
|
|
112
|
+
if (text_field.yScrollShape.hasLocalVariable("job")) {
|
|
113
|
+
text_field.yScrollShape.deleteLocalVariable("job");
|
|
114
|
+
}
|
|
115
|
+
text_field.scrollX = text_field.width * ((textWidth - 2) / text_field.textWidth);
|
|
116
|
+
}
|
|
117
|
+
// fixed logic
|
|
118
|
+
text_field.focusVisible = false;
|
|
119
|
+
text_field.focusIndex = textObject.mode === "text" ? idx - 1 : idx;
|
|
120
|
+
textFieldBlinkingClearTimeoutService();
|
|
121
|
+
textFieldBlinkingUseCase(text_field);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (textObject.line !== targetLine || textObject.mode !== "text") {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
textWidth += textObject.w;
|
|
128
|
+
if (textWidth > currentWidth) {
|
|
129
|
+
if (!shift_key) {
|
|
130
|
+
text_field.selectIndex = -1;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
if (text_field.selectIndex === -1) {
|
|
134
|
+
text_field.selectIndex = text_field.focusIndex - 1;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
if (text_field.selectIndex === idx + 1) {
|
|
138
|
+
text_field.selectIndex = -1;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (startLine > textObject.line) {
|
|
143
|
+
if (text_field.xScrollShape.hasLocalVariable("job")) {
|
|
144
|
+
text_field.xScrollShape.deleteLocalVariable("job");
|
|
145
|
+
}
|
|
146
|
+
text_field.scrollY -= textData.heightTable[textObject.line] / scaleY;
|
|
147
|
+
}
|
|
148
|
+
// fixed logic
|
|
149
|
+
text_field.focusVisible = false;
|
|
150
|
+
text_field.focusIndex = idx;
|
|
151
|
+
textFieldBlinkingClearTimeoutService();
|
|
152
|
+
textFieldBlinkingUseCase(text_field);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TextField } from "../../TextField";
|
|
2
|
+
/**
|
|
3
|
+
* @description テキストの点滅を実行します。
|
|
4
|
+
* Execute text blinking.
|
|
5
|
+
*
|
|
6
|
+
* @param {TextField} text_field
|
|
7
|
+
* @return {void}
|
|
8
|
+
* @method
|
|
9
|
+
* @protected
|
|
10
|
+
*/
|
|
11
|
+
export declare const execute: (text_field: TextField) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { execute as textFieldApplyChangesService } from "../service/TextFieldApplyChangesService";
|
|
2
|
+
import { execute as textAreaMovePositionService } from "../../TextArea/service/TextAreaMovePositionService";
|
|
3
|
+
import { $setBlinkingTimerId } from "../../TextUtil";
|
|
4
|
+
/**
|
|
5
|
+
* @description テキストの点滅を実行します。
|
|
6
|
+
* Execute text blinking.
|
|
7
|
+
*
|
|
8
|
+
* @param {TextField} text_field
|
|
9
|
+
* @return {void}
|
|
10
|
+
* @method
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
export const execute = (text_field) => {
|
|
14
|
+
// update
|
|
15
|
+
text_field.focusVisible = !text_field.focusVisible;
|
|
16
|
+
textFieldApplyChangesService(text_field);
|
|
17
|
+
// next timer
|
|
18
|
+
$setBlinkingTimerId(setTimeout(() => execute(text_field), 500));
|
|
19
|
+
// TextArea move position
|
|
20
|
+
textAreaMovePositionService(text_field);
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TextField } from "../../TextField";
|
|
2
|
+
import type { ITextFieldCharacter } from "../../interface/ITextFieldCharacter";
|
|
3
|
+
/**
|
|
4
|
+
* @description characterを元にTextFieldを構築
|
|
5
|
+
* Build TextField based on character
|
|
6
|
+
*
|
|
7
|
+
* @param {TextField} text_field
|
|
8
|
+
* @param {ITextFieldCharacter} character
|
|
9
|
+
* @return {void}
|
|
10
|
+
* @method
|
|
11
|
+
* @protected
|
|
12
|
+
*/
|
|
13
|
+
export declare const execute: (text_field: TextField, character: ITextFieldCharacter) => void;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description characterを元にTextFieldを構築
|
|
3
|
+
* Build TextField based on character
|
|
4
|
+
*
|
|
5
|
+
* @param {TextField} text_field
|
|
6
|
+
* @param {ITextFieldCharacter} character
|
|
7
|
+
* @return {void}
|
|
8
|
+
* @method
|
|
9
|
+
* @protected
|
|
10
|
+
*/
|
|
11
|
+
export const execute = (text_field, character) => {
|
|
12
|
+
const textFormat = text_field.defaultTextFormat;
|
|
13
|
+
textFormat.font = character.font;
|
|
14
|
+
textFormat.size = character.size;
|
|
15
|
+
textFormat.align = character.align;
|
|
16
|
+
textFormat.color = character.color;
|
|
17
|
+
textFormat.leading = character.leading;
|
|
18
|
+
textFormat.letterSpacing = character.letterSpacing;
|
|
19
|
+
textFormat.leftMargin = character.leftMargin;
|
|
20
|
+
textFormat.rightMargin = character.rightMargin;
|
|
21
|
+
switch (character.fontType) {
|
|
22
|
+
case 1:
|
|
23
|
+
textFormat.bold = true;
|
|
24
|
+
break;
|
|
25
|
+
case 2:
|
|
26
|
+
textFormat.italic = true;
|
|
27
|
+
break;
|
|
28
|
+
case 3:
|
|
29
|
+
textFormat.bold = true;
|
|
30
|
+
textFormat.italic = true;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
// update textFormat
|
|
34
|
+
text_field.defaultTextFormat = textFormat;
|
|
35
|
+
// setup params
|
|
36
|
+
text_field.type = character.inputType;
|
|
37
|
+
text_field.multiline = character.multiline;
|
|
38
|
+
text_field.wordWrap = character.wordWrap;
|
|
39
|
+
text_field.border = character.border;
|
|
40
|
+
text_field.scrollEnabled = character.scroll;
|
|
41
|
+
text_field.thickness = character.thickness;
|
|
42
|
+
text_field.thicknessColor = character.thicknessColor;
|
|
43
|
+
switch (character.autoSize) {
|
|
44
|
+
case 1:
|
|
45
|
+
text_field.autoSize = character.align;
|
|
46
|
+
break;
|
|
47
|
+
case 2:
|
|
48
|
+
text_field.autoFontSize = true;
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
text_field.xMin = text_field.bounds.xMin = character.bounds.xMin;
|
|
54
|
+
text_field.xMax = text_field.bounds.xMax = character.bounds.xMax;
|
|
55
|
+
text_field.yMin = text_field.bounds.yMin = character.bounds.yMin;
|
|
56
|
+
text_field.yMax = text_field.bounds.yMax = character.bounds.yMax + 4;
|
|
57
|
+
text_field.text = character.text;
|
|
58
|
+
};
|