New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore empty lines for line events #43031
Conversation
@@ -299,11 +299,12 @@ export default class PoetryLibrary extends CoreLibrary { | |||
applyGlobalLineAnimation(renderInfo, frameCount) { | |||
// Add 2 so there's time before the first line and after the last line | |||
const framesPerLine = POEM_DURATION / (renderInfo.lines.length + 2); | |||
const nonEmptyLines = renderInfo.lines.filter(line => line.text !== ''); // Ignore empty lines for line events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could line.text
ever be null/undefined or empty but with whitespace " "
? we might want to consider those cases anyways because "empty" could end up meaning any of those things in the future
I think instead of filtering out the blank lines in |
@ajpal So I see we're already filtering lines using the property
|
Oh, yeah that would totally work! (i think) |
1b3a723
to
8b457b0
Compare
export function containsAtLeastOneAlphaNumberic(string) { | ||
return /^.*[a-zA-Z0-9èàùìòÈÀÒÙÌéáúíóÉÁÚÍÓëäüïöËÄÜÏÖêâûîôÊÂÛÎÔç'-]+.*$/.test( | ||
string | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should go into a global stringUtils
type of file. I didn't see one, and so I put it here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated: 6184ff1
@@ -441,7 +441,7 @@ export default class PoetryLibrary extends CoreLibrary { | |||
x: PLAYSPACE_SIZE / 2, | |||
y: yCursor, | |||
size: lineSize, | |||
isPoemBodyLine: true | |||
isPoemBodyLine: utils.containsAtLeastOneAlphaNumberic(line) // Used to skip blank lines in animations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost wonder if we should rename isPoemBodyLine
to canHaveEvent
or something? I feel like that might be a more accurate representation of what it is/ what it's used for and then we might not need as much info in the comments. But doesn't have to be part of these changes.
Ignores blank lines for line events
Skip.empty.lines.mov
Links
PR Checklist: