Skip to content

Commit 33b5278

Browse files
committed
Thumbnail: do not truncate thumbnail border position or shape
For high-dpi displays, this would cause small borders to look very bad because they could be misaligned from the actual thumbnail by more than one display pixel.
1 parent 021b1fc commit 33b5278

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Thumbnail.moon

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,12 @@ class Thumbnail extends BarAccent
4949
hoverTime = mp.get_property_number( 'duration', 0 ) * Mouse.x / Window.w
5050

5151
scaledWidth = @thumbfast.width / Window.osdScale
52-
53-
thumbX = clamp(@lastX, leftMargin + (scaledWidth / 2), Window.w - rightMargin - (scaledWidth / 2))
54-
@line[2] = [[%d,%d]]\format thumbX, Window.h - (bottomMargin - borderExpansion)
52+
thumbX = clamp @lastX, leftMargin + (scaledWidth / 2), Window.w - rightMargin - (scaledWidth / 2)
53+
@line[2] = [[%g,%g]]\format thumbX, Window.h - (bottomMargin - borderExpansion)
5554

5655
width = scaledWidth + (2 * borderExpansion)
5756
height = (@thumbfast.height / Window.osdScale) + (2 * borderExpansion)
58-
@line[4] = [[m 0 0 l %d 0 %d %d 0 %d]]\format width, width, height, height
57+
@line[4] = [[m 0 0 l %g 0 %g %g 0 %g]]\format width, width, height, height
5958

6059
mp.commandv(
6160
'script-message-to', 'thumbfast', 'thumb',

0 commit comments

Comments
 (0)