Fix transparent border rendering and ALIGNVCENTER text alignment#241
Open
vincedarley wants to merge 1 commit intobash0:masterfrom
Open
Fix transparent border rendering and ALIGNVCENTER text alignment#241vincedarley wants to merge 1 commit intobash0:masterfrom
vincedarley wants to merge 1 commit intobash0:masterfrom
Conversation
- Skip drawing borders when color has alpha channel = 00 (transparent) - Parse ALIGNVCENTER from textFormat element and vertically center text in frame - Fixes cover page text rendering issues where transparent borders appeared black and text was not centered despite ALIGNVCENTER attribute
Author
|
Further testing shows this patch is not quite right - it breaks borders on photos. The correct fix for the border issues is this: |
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 two text rendering issues:
Transparent borders appearing as black - When text areas have a border color with alpha channel = 00 (transparent), the border should not be drawn. Now checks the color format #RRGGBBAA and returns early if AA == 00. At least on my version of CEWE it seems to like creating a transparent text border when I tell it I don't want a border at all.
ALIGNVCENTER not being applied - Text with ALIGNVCENTER in the textFormat element was not being vertically centered. Now parses the textFormat child element (not attribute), checks for ALIGNVCENTER in the Alignment attribute, and applies proper vertical centering by shrinking the frame to text size and positioning it centered within the original area.
Changes:
Line ~453: Add alpha channel detection in processDecorationBorders()
Lines ~780-787: Parse textFormat element for ALIGNVCENTER flag
Lines ~1134-1145: Apply vertical centering offset when rendering text frames