Titano: time-lapse ecosystem (client, server, uploader) — in progress #1

Merged
Alby96 merged 204 commits from claude/keen-knuth-uhxv8w into main 2026-10-02 16:29:53 +02:00
Showing only changes of commit ea3de59c72 - Show all commits
@@ -48,6 +48,7 @@ public sealed class VisualsSmokeTests
public void CardFitsTheDefaultGridSlot() => WpfHost.Run(() =>
{
var card = SampleCard();
Host(card);
card.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
Assert.Approximately(236, card.DesiredSize.Width, 0.5);
Assert.LessOrEqual(card.DesiredSize.Height, (double)VirtualizingWrapPanel.ItemHeightProperty.DefaultMetadata.DefaultValue + 0.5);
@@ -236,14 +237,22 @@ public sealed class VisualsSmokeTests
private static RenderTargetBitmap Render(FrameworkElement element, double width, double height)
{
element.Measure(new Size(width, height));
element.Arrange(new Rect(0, 0, width, height));
element.UpdateLayout();
var host = Host(element);
host.Measure(new Size(width, height));
host.Arrange(new Rect(0, 0, width, height));
host.UpdateLayout();
var bitmap = new RenderTargetBitmap((int)width, (int)height, 96, 96, PixelFormats.Pbgra32);
bitmap.Render(element);
bitmap.Render(host);
return bitmap;
}
/// <summary>
/// Gives the element a visual parent, as in a real window: WPF fetches implicit and theme styles (and with them
/// templates) only once an element is initialized, which a bare element created in code never is.
/// </summary>
private static Border Host(FrameworkElement element) =>
element.Parent as Border ?? new Border { Child = element };
private static int Painted(BitmapSource bitmap)
{
var stride = bitmap.PixelWidth * 4;