diff options
Diffstat (limited to 'frontend/app/views/tile/tile.utils.js')
| -rw-r--r-- | frontend/app/views/tile/tile.utils.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/frontend/app/views/tile/tile.utils.js b/frontend/app/views/tile/tile.utils.js index dc19540..c0f92a5 100644 --- a/frontend/app/views/tile/tile.utils.js +++ b/frontend/app/views/tile/tile.utils.js @@ -82,9 +82,12 @@ export const unitsDimension = (tile, dimension, bounds, videoBounds) => { return value + "px" } -export const videoUnits = (value, bounds, videoBounds) => ( - Math.round(value * bounds.width / videoBounds.width) + 'px' -) +export const videoUnits = (value, bounds, videoBounds) => { + if ((videoBounds.width / videoBounds.height) > (bounds.width / bounds.height)) { + return Math.round(value * bounds.height / videoBounds.height) + 'px' + } + return Math.round(value * bounds.width / videoBounds.width) + 'px' +} export const hexToRgb = (hex) => { if (!hex) { |
