Commit dd3597c2 by ibaker Committed by Oliver Woodman

Document that the order of cues passed to TextOutput is important

Fix WebViewSubtitleOutput to respect this (CanvasSubtitleOutput already
does).

Issue: #8704
PiperOrigin-RevId: 365534018
parent 9be84e49
...@@ -25,6 +25,9 @@ public interface TextOutput { ...@@ -25,6 +25,9 @@ public interface TextOutput {
/** /**
* Called when there is a change in the {@link Cue Cues}. * Called when there is a change in the {@link Cue Cues}.
* *
* <p>{@code cues} is in ascending order of priority. If any of the cue boxes overlap when
* displayed, the {@link Cue} nearer the end of the list should be shown on top.
*
* @param cues The {@link Cue Cues}. May be empty. * @param cues The {@link Cue Cues}. May be empty.
*/ */
void onCues(List<Cue> cues); void onCues(List<Cue> cues);
......
...@@ -278,6 +278,7 @@ import java.util.Map; ...@@ -278,6 +278,7 @@ import java.util.Map;
Util.formatInvariant( Util.formatInvariant(
"<div style='" "<div style='"
+ "position:absolute;" + "position:absolute;"
+ "z-index:%s;"
+ "%s:%.2f%%;" + "%s:%.2f%%;"
+ "%s:%s;" + "%s:%s;"
+ "%s:%s;" + "%s:%s;"
...@@ -287,6 +288,7 @@ import java.util.Map; ...@@ -287,6 +288,7 @@ import java.util.Map;
+ "background-color:%s;" + "background-color:%s;"
+ "transform:translate(%s%%,%s%%);" + "transform:translate(%s%%,%s%%);"
+ "'>", + "'>",
/* z-index */ i,
positionProperty, positionProperty,
positionPercent, positionPercent,
lineProperty, lineProperty,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment