From c2c0adada3fd65f3f2200c2247715e04f6570aa6 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Thu, 26 Dec 2024 15:44:01 +0100 Subject: [PATCH] cleaner solution --- BlueWP/Controls/Post/PostBase.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BlueWP/Controls/Post/PostBase.cs b/BlueWP/Controls/Post/PostBase.cs index c017370..eb1b0e9 100644 --- a/BlueWP/Controls/Post/PostBase.cs +++ b/BlueWP/Controls/Post/PostBase.cs @@ -62,11 +62,11 @@ public int VideoHeight { get { - if (PostVideo == null) + if (PostVideo?.aspectRatio == null) { - return 100; + return 200; } - int height = PostVideo.aspectRatio == null ? 400 : (int)(ActualWidth * PostVideo.aspectRatio.height / PostVideo.aspectRatio.width); + int height = (int)(ActualWidth * PostVideo.aspectRatio.height / PostVideo.aspectRatio.width); height = Math.Min(height, 400); return height; }