Skip to content
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

Fix subtitle margin #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix subtitle margin #40

wants to merge 1 commit into from

Conversation

sajadspeed
Copy link

Set margin from the bottom when OSC is visible.

request_tick()
end

function subtitle_fix()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better to adjust subtitle positioning based on the resolution of the window, else subtitles are obstructed.

function adjustSubtitles()
    if user_opts.raisesubswithosc and state.osc_visible == true and (state.fullscreen == false or user_opts.showfullscreen) then
        local w, h = mp.get_osd_size()
        if h > 0 then
            mp.commandv('set', 'sub-pos', math.floor((osc_param.playresy - 175)/osc_param.playresy*100)) -- percentage
        end
	else
		mp.commandv('set', 'sub-pos', 100)
	end	
end

This is my solution to this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't exactly understand your code, but I replaced the function you wrote with my own function, but it didn't work. Did I make a mistake somewhere?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I'm sorry! I may have changed the subroutine name in my code from subtitle_fix() to adjustSubtitles(), try that!

I didn't exactly understand your code, but I replaced the function you wrote with my own function, but it didn't work. Did I make a mistake somewhere?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this. I replaced the code inside the function you wrote with my own code and it didn't work.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh im sorry ... it's the user_opts.raisesubswithosc ... remove that (and the and) and maybe it'll work? Sorry my own fork is slightly different in the implementation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh im sorry ... it's the user_opts.raisesubswithosc ... remove that (and the and) and maybe it'll work? Sorry my own fork is slightly different in the implementation.

No, that didn't work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants