@@ -411,11 +411,11 @@ settings['enable-thumbnail'] = true
411
411
helpText [' enable-thumbnail' ] = [[ Sets whether or not thumbnails are displayed at all. Note: thumbnail display
412
412
requires use of the thumbfast script (See: https://github.com/po5/thumbfast).
413
413
]]
414
- settings [' thumbnail-left-margin' ] = 10
414
+ settings [' thumbnail-left-margin' ] = 4
415
415
helpText [' thumbnail-left-margin' ] = [[ Controls how close to the left edge of the window the thumbnail display can
416
416
get.
417
417
]]
418
- settings [' thumbnail-right-margin' ] = 10
418
+ settings [' thumbnail-right-margin' ] = 4
419
419
helpText [' thumbnail-right-margin' ] = [[ Controls how close to the right edge of the window the thumbnail display can
420
420
get.
421
421
]]
@@ -2229,7 +2229,7 @@ end
2229
2229
local Thumbnail
2230
2230
do
2231
2231
local _class_0
2232
- local rightMargin , leftMargin , bottomMargin , borderExpansion , boxStyle
2232
+ local bottomMargin , borderExpansion , rightMargin , leftMargin , boxStyle
2233
2233
local _parent_0 = BarAccent
2234
2234
local _base_0 = {
2235
2235
updateInfo = function (self , thumbfastInfo )
2240
2240
reconfigure = function (self )
2241
2241
_class_0 .__parent .__base .reconfigure (self )
2242
2242
rightMargin = settings [' thumbnail-right-margin' ]
2243
- leftMargin = settings [' thumbnail-left-margin' ]
2244
- bottomMargin = settings [' thumbnail-bottom-margin' ]
2245
2243
borderExpansion = settings [' thumbnail-border-expansion' ]
2244
+ leftMargin = settings [' thumbnail-left-margin' ] + borderExpansion
2245
+ bottomMargin = settings [' thumbnail-bottom-margin' ] + borderExpansion
2246
2246
self .line [3 ] = boxStyle :format (settings [' default-style' ], settings [' thumbnail-border-style' ])
2247
2247
end ,
2248
2248
activate = function (self , activate )
@@ -2258,11 +2258,13 @@ do
2258
2258
if Mouse .x ~= self .lastX and not self .thumbfast .disabled then
2259
2259
self .lastX = Mouse .x
2260
2260
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 )
2263
2265
local height = (self .thumbfast .height / Window .osdScale ) + (2 * borderExpansion )
2264
2266
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 ) )
2266
2268
end
2267
2269
self .needsUpdate = true
2268
2270
end
@@ -2306,10 +2308,10 @@ do
2306
2308
})
2307
2309
_base_0 .__class = _class_0
2308
2310
local self = _class_0
2309
- rightMargin = settings [' thumbnail-right-margin' ]
2310
- leftMargin = settings [' thumbnail-left-margin' ]
2311
2311
bottomMargin = settings [' thumbnail-bottom-margin' ]
2312
2312
borderExpansion = settings [' thumbnail-border-expansion' ]
2313
+ rightMargin = settings [' thumbnail-right-margin' ] + borderExpansion
2314
+ leftMargin = settings [' thumbnail-left-margin' ] + borderExpansion
2313
2315
boxStyle = [[ )\an2%s%s\p1}]]
2314
2316
if _parent_0 .__inherited then
2315
2317
_parent_0 .__inherited (_parent_0 , _class_0 )
0 commit comments