-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement split vertical margin properties MarginB/T
MarginB Style and Event are ignored when not in v4++ mode, but as style overrides all Margin* fields act independent of version with MarginV always setting both fields and MarinT/B only ever one. In order to not break API, some complexity had to be introduced: To keep API compatibility with styles created via API, we need to decide at rendering time between using the styles MarginV or MarginB as the bottom margin based on track version. Since such styles never go through our parsing logic and MarginB didn't exist until now, they'll might have MarginB set to 0 but expect MarginV to apply to both. To keep API-compatibility with a mix of API-created styles and user overrides, it is necessary to track per style if it was affected by a MarginT or MarginB override. If either was overriden, we'll use the split margin values at render time even for non-v4++ files. Access to MarginB needs to be tracked separate from MarginT, otherwise incompatibilities can still arise. Consider an override applied to an API-created style which originally didn't set MarginB: If we didn't know whether MarginB was already set by an override, overrinding only MarginT would either suddenly set MarginB to zero or destroy the value set by a previous override. After a potential future API break, renaming the MarginV struct member to MarginT and requiring API-created styles to set both independent of version, all this complexitiy can be dropped. TODO: Before merging the override bitmap logic should best be checked carefully again as it wasn't examined or tested carefully yet.
- Loading branch information
Showing
5 changed files
with
63 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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