Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Support \clip and \iclip #72

Open
Arnavion opened this issue Mar 10, 2016 · 0 comments
Open

Support \clip and \iclip #72

Arnavion opened this issue Mar 10, 2016 · 0 comments

Comments

@Arnavion
Copy link
Owner

  • New flag on Dialogue - containsClipTag
  • New property on PreRenderedSub - renderedPosition. null by default. Updated at some time after sub is drawn. (When? Can't do it in next renderer clock tick because it might be paused. Separate rAF timer?)
  • Generate clip parameters using renderedPosition and persist on PreRenderedSub
  • Set visibility: hidden on the sub meanwhile.
  • Won't work for dialogues containing \t since those are not cached. Any workarounds?
  • If the sub is absolutely positioned (i.e. the dialogue contains \pos or \move) this is fine. Otherwise the sub may be rendered at different positions based on seeking behavior, and the previous calculated clip will persist. Maybe always calculate the sub position first, and only apply the cached clip if the cached position matches, else recalculate the clip? Or maybe it's not worth it.
<Kanmuri> So, a question about clipping. Is that not possible with the current renderer, or just hasn't been implemented yet?
<~Arnavion> Clipping can be done with CSS / SVG, but the values in the ASS are relative to the top-left of the viewport, whereas libjass doesn't know anything about where a subtitle <div> ends up on the web page
<~Arnavion> since it leaves layout to the browser
<~Arnavion> It *could* be done by rendering the sub without clipping, waiting a tick, recording its dimensions, then apply the clip, but that's hacky and the "tick" will be long enough to have the unclipped sub be visible
<Kanmuri> What about rendering the sub as transparent, clipping, then changing it to visible?
<~Arnavion> I can't think of any issues with that
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant