fix: speed_opacity option being ignored

closes #231
This commit is contained in:
tomasklaen
2022-09-21 14:10:59 +02:00
parent a4257d7c31
commit 6d54e0fdfe
2 changed files with 8 additions and 8 deletions

View File

@@ -91,16 +91,16 @@ controls_persistency=
volume=right
volume_size=40
volume_size_fullscreen=52
volume_persistency=
volume_opacity=0.9
volume_border=1
volume_step=1
volume_persistency=
# Playback speed widget: mouse drag or wheel to change, click to reset
speed_persistency=
speed_opacity=1
speed_opacity=0.6
speed_step=0.1
speed_step_is_factor=no
speed_persistency=
# Controls all menus, such as context menu, subtitle loader/selector, etc
menu_item_height=36
@@ -117,9 +117,9 @@ menu_parent_opacity=0.4
top_bar=no-border
top_bar_size=40
top_bar_size_fullscreen=46
top_bar_persistency=
top_bar_controls=yes
top_bar_title=yes
top_bar_persistency=
# Window border drawn in no-border mode
window_border_size=1

View File

@@ -34,7 +34,7 @@ function serialize_rgba(rgba)
local a = rgba:sub(7, 8)
return {
color = rgba:sub(5, 6) .. rgba:sub(3, 4) .. rgba:sub(1, 2),
opacity = clamp(0, tonumber(#a == 2 and a or 'ff', 16) / 255, 1)
opacity = clamp(0, tonumber(#a == 2 and a or 'ff', 16) / 255, 1),
}
end
@@ -185,7 +185,7 @@ local options = {
volume_step = 1,
speed_persistency = '',
speed_opacity = 1,
speed_opacity = 0.6,
speed_step = 0.1,
speed_step_is_factor = false,
@@ -2319,7 +2319,7 @@ function Speed:render()
-- Background
ass:rect(self.ax, self.ay, self.bx, self.by, {
color = options.background, radius = 2, opacity = opacity * 0.6,
color = options.background, radius = 2, opacity = opacity * options.speed_opacity,
})
-- Coordinates
@@ -2367,7 +2367,7 @@ function Speed:render()
-- Center guide
ass:new_event()
ass:append('{\\blur0\\bord1\\shad0\\1c&H' .. options.foreground .. '\\3c&H' .. options.background .. '}')
ass:opacity(options.speed_opacity, opacity)
ass:opacity(opacity)
ass:pos(0, 0)
ass:draw_start()
ass:move_to(half_x, by - 2 - guide_size)