Closed gazadge closed 3 years ago
Make sense, apply transform before content mode is better in this case.
@vitoziv thank you for your fast response! 👍
I updated the pod version to 0.5.1
in the podspec. Can you draft a new release for the repository with version 0.5.1
so this patch can be published on Cocoapods?
I pushed version 0.5.1
to Cocoapods, you can try it later.
Awesome, thanks Vito!
Context:
TrackConfiguration
's transform property lets developers applying custom transformations onTrackItem
whileTrackConfiguration
'scontentMode
is responsible for how theTrackItem
's content is displayed on screen (aspectFit
/aspectFill
/custom
).Issue: The CGAffineTransform stored in
TrackConfiguration
'stransform
property gets applied only after the contentMode transformations, so if a user transformation (e.g. rotation by 90 degrees) is set then .aspectFit and .aspectFill content modes won't work as expected:https://github.com/VideoFlint/Cabbage/blob/e65b80fc04c026d14ca0a3a3ed0567d597233f86/Cabbage/Sources/Track/Configuration/TrackConfiguration.swift#L61-L84
Proposed solution: Move the user transform implementation just before the contentMode transformations.
@vitoziv what do you think? I would expect the content modes to work even if the TrackItem is e.g. rotated via the transform property, but I also don't know how you specify the purpose of transform property.
I'll create a pull request for this, please let me know what's your take on this proposal.