-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[Subtitles] Avoid using res and overscan (use rectview instead) #14371
Conversation
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.
Using res and overscan is wrong because it breaks windowed mode. RectView and RectDest do already consider overscan. Means you have to fix the old code
|
res.Overscan is already used above to calculate width_max and y. This is wrong and this is what i mean with old code |
Ok, I'll give it a go |
@FernetMenta thanks. Can you check if this is correct now? |
@@ -432,7 +432,11 @@ COverlay* CRenderer::Convert(CDVDOverlay* o, double pts) | |||
#endif | |||
|
|||
if(!r && o->IsOverlayType(DVDOVERLAY_TYPE_TEXT)) | |||
r = new COverlayText(static_cast<CDVDOverlayText*>(o)); | |||
{ | |||
int targetWidth = MathUtils::round_int(m_rv.Width()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
{ | ||
int targetWidth = MathUtils::round_int(m_rv.Width()); | ||
int targetHeight = MathUtils::round_int(m_rv.Height()); | ||
r = new COverlayText(static_cast<CDVDOverlayText*>(o), targetWidth, targetHeight); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -136,6 +136,10 @@ COverlayText::COverlayText(CDVDOverlayText * src) | |||
|
|||
m_type = TYPE_GUITEXT; | |||
|
|||
// entire area of screen |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@FernetMenta mind taking another look? :) |
looks good. just one minor, see comment |
@@ -136,6 +136,8 @@ COverlayText::COverlayText(CDVDOverlayText * src) | |||
|
|||
m_type = TYPE_GUITEXT; | |||
|
|||
// target rect (updated on PrepareRender) | |||
m_rv = CRect(0, 0, 0, 0); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Comment addressed, should be all good now. Thanks a lot (again) for all your comments! |
Description
Overscan was not being taken into account when drawing the subtitle background causing the background to deviate from the rendered subs.
Motivation and Context
Fix behaviour. Some old tv models force us to use overscan to fix the screen positioning. If a user in those conditions defines a non-opaque background for subtitles, the end result is a mess.
How Has This Been Tested?
Compiled, run time tested, multiple variations of overscan settings, old tv as secondary monitor.
Screenshots (if appropriate):
Master:
![master Master](https://camo.githubusercontent.com/af6b309afbb85d3098e87dfbd4e1df12ef61882c5fbf945ccfbc842f2858bc53/68747470733a2f2f7333332e706f7374696d672e63632f3664696f7862676d372f73637265656e73686f743030342e706e67)
This PR:
![fix fix](https://camo.githubusercontent.com/8212f5926863a604171eb0bc2eadf47056be2f7620a706a2aeefca8916471c06/68747470733a2f2f7333332e706f7374696d672e63632f6e33796f30327267762f73637265656e73686f743030322e706e67)
Types of change
Checklist: