From 5e2ebba8f6454dc059af2c384fa32f4e2e9a6779 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Tue, 19 Apr 2022 17:50:34 +0100 Subject: [PATCH] Switch to letting roku scale the Poster Image with scaleToFit --- components/ListPoster.brs | 26 +++++++------------------- components/ListPoster.xml | 2 +- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/components/ListPoster.brs b/components/ListPoster.brs index 39368053..dc2d7fe0 100644 --- a/components/ListPoster.brs +++ b/components/ListPoster.brs @@ -30,31 +30,19 @@ sub updateSize() ' Always reserve the bottom for the Poster Title m.title.maxWidth = maxSize[0] - m.title.height = 70 - m.title.translation = [0, int(maxSize[1]) - (m.title.height-30)] + m.title.height = 40 + m.title.translation = [0, int(maxSize[1]) - m.title.height + 5] print "[0," int(maxSize[1]) - m.title.height"]" m.staticTitle.width = maxSize[0] - m.staticTitle.height = 70 - m.staticTitle.translation = [0, int(maxSize[1]) - (m.title.height-30)] - - ratio = 1.5 - if image <> invalid and image.width <> 0 and image.height <> 0 - ratio = image.height / image.width - end if + m.staticTitle.height = m.title.height + m.staticTitle.translation = m.title.translation m.poster.width = int(maxSize[0]) - 4 - m.poster.height = m.poster.width * ratio + m.poster.height = int(maxSize[1]) - m.title.height 'Set poster height to available space - posterVertSpace = int(maxSize[1]) - m.title.height - 20 - - if m.poster.height > posterVertSpace - ' Do a thing to shrink the image if it is too tall - end if - - m.poster.translation = [2, (posterVertSpace - m.poster.height) / 3] - - m.backdrop.translation = [2, (posterVertSpace - m.poster.height) / 2] + + m.backdrop.width = m.poster.width m.backdrop.height = m.poster.height diff --git a/components/ListPoster.xml b/components/ListPoster.xml index 0a478120..a3b3f89d 100644 --- a/components/ListPoster.xml +++ b/components/ListPoster.xml @@ -2,7 +2,7 @@ - +