mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
createGradient fn fixed
This commit is contained in:
@@ -75,7 +75,7 @@ const TorrentCache = ({ cache, isMini }) => {
|
|||||||
|
|
||||||
ctx.lineWidth = borderWidth
|
ctx.lineWidth = borderWidth
|
||||||
ctx.fillStyle = inProgress
|
ctx.fillStyle = inProgress
|
||||||
? createGradient(ctx, percentage)
|
? createGradient(ctx, percentage, pieceSize)
|
||||||
: isCompleted
|
: isCompleted
|
||||||
? completeColor
|
? completeColor
|
||||||
: isMini
|
: isMini
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ export const progressColor = '#86beee'
|
|||||||
export const activeColor = '#000'
|
export const activeColor = '#000'
|
||||||
export const rangeColor = '#afa6e3'
|
export const rangeColor = '#afa6e3'
|
||||||
|
|
||||||
export const createGradient = (ctx, percentage) => {
|
export const createGradient = (ctx, percentage, pieceSize) => {
|
||||||
const gradient = ctx.createLinearGradient(0, 12, 0, 0)
|
const gradient = ctx.createLinearGradient(0, pieceSize, 0, 0)
|
||||||
gradient.addColorStop(0, completeColor)
|
gradient.addColorStop(0, completeColor)
|
||||||
gradient.addColorStop(percentage / 100, completeColor)
|
gradient.addColorStop(percentage / 100, completeColor)
|
||||||
gradient.addColorStop(percentage / 100, progressColor)
|
gradient.addColorStop(percentage / 100, progressColor)
|
||||||
|
|||||||
Reference in New Issue
Block a user