Skip to content

Commit b1e443b

Browse files
committed
feat: upgrade to .NET 10 and improve cursor rendering logic
- Update target framework to .NET 10 in `VcrSharp.Docs.csproj`. - Upgrade `MyLittleContentEngine.DocSite` package to version `0.0.0-alpha.0.277`. - Enhance cursor rendering by adding conditional support for blinking based on `_options.CursorBlink`. - Prevent unnecessary cursor animation when blinking is disabled.
1 parent 65071cc commit b1e443b

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="MyLittleContentEngine.DocSite" Version="0.0.0-alpha.0.220" />
10+
<PackageReference Include="MyLittleContentEngine.DocSite" Version="0.0.0-alpha.0.277" />
1111
</ItemGroup>
1212

1313
</Project>

src/VcrSharp.Infrastructure/Rendering/SvgRenderer.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ public async Task RenderAnimatedAsync(
191191
// Render each unique row state with SMIL visibility animations
192192
await RenderRowsWithSmilAsync(xml, rowTimeline, totalDurationSeconds);
193193

194-
// Render cursor with SMIL position animation
195-
if (!_options.DisableCursor)
194+
// Render cursor with SMIL position animation (skip if cursor is disabled or not blinking)
195+
if (!_options.DisableCursor && _options.CursorBlink)
196196
{
197197
await RenderCursorWithSmilAsync(xml, cursorTimeline, totalDurationSeconds);
198198
}
@@ -700,14 +700,17 @@ private async Task RenderCursorWithSmilAsync(XmlWriter xml, List<CursorKeyframe>
700700
await xml.WriteEndElementAsync();
701701
}
702702

703-
// Cursor blink animation
704-
await xml.WriteStartElementAsync(null, "animate", null);
705-
await xml.WriteAttributeStringAsync(null, "attributeName", null, "opacity");
706-
await xml.WriteAttributeStringAsync(null, "values", null, "1;0;1");
707-
await xml.WriteAttributeStringAsync(null, "keyTimes", null, "0;0.5;1");
708-
await xml.WriteAttributeStringAsync(null, "dur", null, "1s");
709-
await xml.WriteAttributeStringAsync(null, "repeatCount", null, "indefinite");
710-
await xml.WriteEndElementAsync();
703+
// Cursor blink animation (only if enabled)
704+
if (_options.CursorBlink)
705+
{
706+
await xml.WriteStartElementAsync(null, "animate", null);
707+
await xml.WriteAttributeStringAsync(null, "attributeName", null, "opacity");
708+
await xml.WriteAttributeStringAsync(null, "values", null, "1;0;1");
709+
await xml.WriteAttributeStringAsync(null, "keyTimes", null, "0;0.5;1");
710+
await xml.WriteAttributeStringAsync(null, "dur", null, "1s");
711+
await xml.WriteAttributeStringAsync(null, "repeatCount", null, "indefinite");
712+
await xml.WriteEndElementAsync();
713+
}
711714

712715
await xml.WriteEndElementAsync(); // rect
713716
}

0 commit comments

Comments
 (0)