fix: search all lines for customType markers in scripture auto-sizing#2648
Merged
vassbo merged 2 commits intoChurchApps:devfrom Jan 9, 2026
Merged
Conversation
The customTypeRatio calculation was only searching the first line (lines[0]) for verse numbers marked with customType: 'disableTemplate'. In templates where verse numbers appear in other lines (e.g., line 1), this caused the ratio to default to 1.0 instead of the correct value (e.g., 0.6 for 60px verse numbers). This resulted in inconsistent auto-sizing where some verses would be calculated with extremely small font sizes because the algorithm treated the verse number as if it should be the same size as the verse text. Fixed by iterating through all lines to find customType markers in both: - deriveCustomTypeRatio() function - calculateAutosize() function Now correctly calculates the verse number to text ratio regardless of which line contains the verse numbers.
Collaborator
|
Nice, this looks fine to me. |
vassbo
added a commit
that referenced
this pull request
Jan 9, 2026
* Fixed pro5 import issue * Fixed clear audio not stopping playlist * Fixed dropdown closing too quick - Restoring old settings won't mess up the data path * Group name replaced when changing background if same name as previous * Fixed incorrect scripture selection order sometimes * Groups number tip * Added support for B1 plans containing lesson items. * Fixed custom icons white default color #2605 * Fixed template text sometimes removed if different item order #2607 * Fixed non text items duplicated on text edit changes * Trying to prevent crash #2612 * Template image is prioritized #2613 - Template popup ordered by scripture * Updated languages * Media reading improvements - Recursive audio folder search - Fixes #2615 * Toggle text edit shortcut #2644 * Quick create audio folder from media folder #2178 - Media updates * Added Traditional Chinese * Fixed playlist highlight create - Fixed project folder buttons scroll - Fixed spaces in text edit not working well * Fixed stage display next scripture text not working #2636 * Stage sizes auto update when window size changes #2604 - Smaller stage labels on small screens * Auto detect new media/project files * Skip too large string type files when importing * Timer easly warning color #2581 * Fixed API scripture next/previous verse not working #2627 * Add verse select (#2630) * Add verse select * Move play button on mobile * macOS go back workaround #2614 * Style template only used as preview if all outputs styles has a custom template #2608 * Replace certain scripture HTML tags #2553 * B1.Church songs import fix * Tweaks * fix: search all lines for customType markers in scripture auto-sizing (#2648) * fix: search all lines for customType markers in scripture auto-sizing The customTypeRatio calculation was only searching the first line (lines[0]) for verse numbers marked with customType: 'disableTemplate'. In templates where verse numbers appear in other lines (e.g., line 1), this caused the ratio to default to 1.0 instead of the correct value (e.g., 0.6 for 60px verse numbers). This resulted in inconsistent auto-sizing where some verses would be calculated with extremely small font sizes because the algorithm treated the verse number as if it should be the same size as the verse text. Fixed by iterating through all lines to find customType markers in both: - deriveCustomTypeRatio() function - calculateAutosize() function Now correctly calculates the verse number to text ratio regardless of which line contains the verse numbers. * Fixed formatting --------- Co-authored-by: Kristoffer <kristoffervassbo@gmail.com> * Fix scripture template override applying wrong styles to verses 2+ (#2653) * Fix scripture template override applying wrong styles to verses 2+ When using 'Overwrite Scripture with Template' in output styles, verses beyond the first were getting matched to the wrong template text object (falling back to text[0] which is the verse number template instead of verse text template). Now intelligently matches verse text objects to {scripture_text} placeholder and verse numbers to {scripture_number} placeholder based on customType flag. * Fixed formatting - Fixed type --------- Co-authored-by: Kristoffer <kristoffervassbo@gmail.com> * Trying to remove extra fullscreen menu #2651 * Fixing errors * Updates * ChurchApps Cloud Sync (#2655) * ChurchApps Cloud Sync * Progress - Fixed async rename/delete not awaited * Updates * Changed hostname - Fixed too many open files backup issue * Attach file as blob. Fetch from S3 instead of API * Fixed latest zip deleted * Backup downloads supress errors * Fixed id issue * Updated my teams api url * Tweaks * Updates * Fix * Finalizing --------- Co-authored-by: Jeremy Zongker <jeremy@zongker.net> * Cloud updates - Version update - Audit fixes * Fixes --------- Co-authored-by: Jeremy Zongker <jeremy@zongker.net> Co-authored-by: Gladson Sam <115465353+gladsonsam@users.noreply.github.com> Co-authored-by: Yuri Vidal <yurividal@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes https://github.com/orgs/ChurchApps/discussions/728
The reason that it was happening is:
The customTypeRatio calculation was only searching the first line (lines[0]) for verse numbers marked with customType: 'disableTemplate'. In templates where verse numbers appear in other lines (e.g., line 1), this caused the ratio to default to 1.0 instead of the correct value (e.g., 0.6 for 60px verse numbers).
This resulted in inconsistent auto-sizing where some verses would be calculated with extremely small font sizes because the algorithm treated the verse number as if it should be the same size as the verse text.
Fixed by iterating through all lines to find customType markers in both:
Now correctly calculates the verse number to text ratio regardless of which line contains the verse numbers.
Let me know what you think of this approach.