Skip to content

Commit a5bb483

Browse files
committed
RenderSelectionToBitmap: fix font size
1 parent 9dbe619 commit a5bb483

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/CodeSnip/MainWindow.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,13 +852,14 @@ private RenderTargetBitmap RenderSelectionToBitmap(ICSharpCode.AvalonEdit.Editin
852852
var codeBrush = new VisualBrush(virtualEditor);
853853
dc.DrawRectangle(codeBrush, null, new Rect(padding, padding, contentWidth, contentHeight));
854854

855+
double fontSize = totalWidth > 200 ? 12 : 8;
855856
// Layer 3: Draw the watermark
856857
var watermarkText = new FormattedText(
857858
"Generated by CodeSnip",
858859
System.Globalization.CultureInfo.CurrentCulture,
859860
FlowDirection.LeftToRight,
860861
new Typeface(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
861-
12,
862+
fontSize,
862863
new SolidColorBrush(Color.FromArgb(128, 170, 170, 170)), // Semi-transparent gray
863864
VisualTreeHelper.GetDpi(this).PixelsPerDip);
864865

0 commit comments

Comments
 (0)