Skip to content

Commit 94860c0

Browse files
committed
Updated code as per review comments
1 parent 986a816 commit 94860c0

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

docs/plugins/subtitles.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,11 @@ Sets the maximum number of lines for the Subtitles text.
142142
```js
143143
Subtitles.maxLines(2)
144144
```
145+
146+
### textFormat
147+
148+
Gets the text format(fontFace, fontSize, lineHeight, textAlign, wordWrap, maxLines, textColor) of the text
149+
150+
```js
151+
Subtitles.textFormat()
152+
```

src/Subtitles/SubtitleComponent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default class SubtitleComponent extends Lightning.Component {
4949
this.tag('Text').on('txLoaded', ({ _source }) => {
5050
this.w = _source.w + this.tag('Text').x * 2
5151
this.h = _source.h
52-
this.position()
52+
this.position() //TODO
5353
})
5454
}
5555

@@ -62,6 +62,7 @@ export default class SubtitleComponent extends Lightning.Component {
6262
textAlign: textTag.textAlign,
6363
wordWrap: true,
6464
maxLines: textTag.maxLines,
65+
textColor: textTag.textColor
6566
}
6667
}
6768

@@ -146,7 +147,7 @@ export default class SubtitleComponent extends Lightning.Component {
146147
}
147148

148149
set fontColor(v) {
149-
this.tag('Text').color = v
150+
this.tag('Text').text.textColor = v
150151
}
151152

152153
set backgroundColor(v) {

src/Subtitles/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,8 @@ export default {
102102
const subtitles = getOrCreateSubtitlesComponent()
103103
subtitles.text = ''
104104
},
105+
textFormat() {
106+
const subtitles = getOrCreateSubtitlesComponent()
107+
return subtitles.textFormat
108+
}
105109
}

0 commit comments

Comments
 (0)