mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix(MarkableTimeBar): align segments to timebar
Due to a error in the timebar position calculation, segments could be msialigned by a pixel. This is fixed by using a caculation that more closely matches how the actual timebar is drawn.
This commit is contained in:
parent
2ae689c74d
commit
ea6483df74
@ -38,7 +38,7 @@ class MarkableTimeBar(
|
||||
canvas.save()
|
||||
val horizontalOffset = (parent as View).marginLeft
|
||||
length = canvas.width - horizontalOffset * 2
|
||||
val marginY = canvas.height / 2 - progressBarHeight / 2
|
||||
val marginY = (canvas.height - progressBarHeight) / 2
|
||||
val themeColor = ThemeHelper.getThemeColor(context, R.attr.colorOnSecondary)
|
||||
|
||||
segments.forEach {
|
||||
@ -49,7 +49,7 @@ class MarkableTimeBar(
|
||||
start.toLength() + horizontalOffset,
|
||||
marginY,
|
||||
end.toLength() + horizontalOffset,
|
||||
canvas.height - marginY
|
||||
marginY + progressBarHeight
|
||||
),
|
||||
Paint().apply {
|
||||
color = if (PreferenceHelper.getBoolean("sb_enable_custom_colors", false)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user