Skip to content

Commit 64a5d2f

Browse files
committed
Update build.
4a9408f
1 parent a3bb8cd commit 64a5d2f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

progressbar.lua

+12-10
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ settings['enable-thumbnail'] = true
411411
helpText['enable-thumbnail'] = [[Sets whether or not thumbnails are displayed at all. Note: thumbnail display
412412
requires use of the thumbfast script (See: https://github.com/po5/thumbfast).
413413
]]
414-
settings['thumbnail-left-margin'] = 10
414+
settings['thumbnail-left-margin'] = 4
415415
helpText['thumbnail-left-margin'] = [[Controls how close to the left edge of the window the thumbnail display can
416416
get.
417417
]]
418-
settings['thumbnail-right-margin'] = 10
418+
settings['thumbnail-right-margin'] = 4
419419
helpText['thumbnail-right-margin'] = [[Controls how close to the right edge of the window the thumbnail display can
420420
get.
421421
]]
@@ -2229,7 +2229,7 @@ end
22292229
local Thumbnail
22302230
do
22312231
local _class_0
2232-
local rightMargin, leftMargin, bottomMargin, borderExpansion, boxStyle
2232+
local bottomMargin, borderExpansion, rightMargin, leftMargin, boxStyle
22332233
local _parent_0 = BarAccent
22342234
local _base_0 = {
22352235
updateInfo = function(self, thumbfastInfo)
@@ -2240,9 +2240,9 @@ do
22402240
reconfigure = function(self)
22412241
_class_0.__parent.__base.reconfigure(self)
22422242
rightMargin = settings['thumbnail-right-margin']
2243-
leftMargin = settings['thumbnail-left-margin']
2244-
bottomMargin = settings['thumbnail-bottom-margin']
22452243
borderExpansion = settings['thumbnail-border-expansion']
2244+
leftMargin = settings['thumbnail-left-margin'] + borderExpansion
2245+
bottomMargin = settings['thumbnail-bottom-margin'] + borderExpansion
22462246
self.line[3] = boxStyle:format(settings['default-style'], settings['thumbnail-border-style'])
22472247
end,
22482248
activate = function(self, activate)
@@ -2258,11 +2258,13 @@ do
22582258
if Mouse.x ~= self.lastX and not self.thumbfast.disabled then
22592259
self.lastX = Mouse.x
22602260
local hoverTime = mp.get_property_number('duration', 0) * Mouse.x / Window.w
2261-
self.line[2] = ([[%d,%d]]):format(self.lastX, Window.h - (bottomMargin - borderExpansion))
2262-
local width = (self.thumbfast.width / Window.osdScale) + (2 * borderExpansion)
2261+
local scaledWidth = self.thumbfast.width / Window.osdScale
2262+
local thumbX = clamp(self.lastX, leftMargin + (scaledWidth / 2), Window.w - rightMargin - (scaledWidth / 2))
2263+
self.line[2] = ([[%d,%d]]):format(thumbX, Window.h - (bottomMargin - borderExpansion))
2264+
local width = scaledWidth + (2 * borderExpansion)
22632265
local height = (self.thumbfast.height / Window.osdScale) + (2 * borderExpansion)
22642266
self.line[4] = ([[m 0 0 l %d 0 %d %d 0 %d]]):format(width, width, height, height)
2265-
mp.commandv('script-message-to', 'thumbfast', 'thumb', hoverTime, clamp(Mouse._rawX - self.thumbfast.width / 2, leftMargin, Window._rawW - self.thumbfast.width - rightMargin), Window._rawH - bottomMargin * Window.osdScale - self.thumbfast.height)
2267+
mp.commandv('script-message-to', 'thumbfast', 'thumb', hoverTime, clamp(Mouse._rawX - self.thumbfast.width / 2, leftMargin * Window.osdScale, Window._rawW - self.thumbfast.width - (rightMargin * Window.osdScale)), Window._rawH - self.thumbfast.height - (bottomMargin * Window.osdScale))
22662268
end
22672269
self.needsUpdate = true
22682270
end
@@ -2306,10 +2308,10 @@ do
23062308
})
23072309
_base_0.__class = _class_0
23082310
local self = _class_0
2309-
rightMargin = settings['thumbnail-right-margin']
2310-
leftMargin = settings['thumbnail-left-margin']
23112311
bottomMargin = settings['thumbnail-bottom-margin']
23122312
borderExpansion = settings['thumbnail-border-expansion']
2313+
rightMargin = settings['thumbnail-right-margin'] + borderExpansion
2314+
leftMargin = settings['thumbnail-left-margin'] + borderExpansion
23132315
boxStyle = [[)\an2%s%s\p1}]]
23142316
if _parent_0.__inherited then
23152317
_parent_0.__inherited(_parent_0, _class_0)

0 commit comments

Comments
 (0)