diff --git a/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.Designer.cs b/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.Designer.cs index 4dabf4e04..44b2b0db1 100644 --- a/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.Designer.cs +++ b/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.Designer.cs @@ -240,6 +240,7 @@ private void InitializeComponent() this.Name = "TextDrawingInputBox"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.TopMost = true; + this.Shown += new System.EventHandler(this.TextDrawingInputBox_Shown); this.flpProperties.ResumeLayout(false); this.flpProperties.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudTextSize)).EndInit(); diff --git a/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.cs b/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.cs index 2db79c1f5..181f00b55 100644 --- a/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.cs +++ b/ShareX.ScreenCaptureLib/Forms/TextDrawingInputBox.cs @@ -77,6 +77,11 @@ public TextDrawingInputBox(string text, TextDrawingOptions options) UpdateVerticalAlignmentImage(); } + private void TextDrawingInputBox_Shown(object sender, EventArgs e) + { + this.ForceActivate(); + } + private void cbFonts_SelectedIndexChanged(object sender, EventArgs e) { Options.Font = cbFonts.SelectedItem as string; diff --git a/ShareX.ScreenCaptureLib/AnnotationOptions.cs b/ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs similarity index 100% rename from ShareX.ScreenCaptureLib/AnnotationOptions.cs rename to ShareX.ScreenCaptureLib/Shapes/AnnotationOptions.cs diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs index ba6bd87ab..41b420866 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingShape.cs @@ -56,7 +56,7 @@ public override void Draw(Graphics g) public override void DrawFinal(Graphics g, Bitmap bmp) { - if (!string.IsNullOrEmpty(Text)) + if (!string.IsNullOrEmpty(Text) && Rectangle.Width > 10 && Rectangle.Height > 10) { DrawText(g); } @@ -65,12 +65,10 @@ public override void DrawFinal(Graphics g, Bitmap bmp) private void DrawText(Graphics g) { using (Font font = new Font(Options.Font, Options.Size, Options.Style)) + using (Brush textBrush = new SolidBrush(Options.Color)) using (StringFormat sf = new StringFormat { Alignment = Options.AlignmentHorizontal, LineAlignment = Options.AlignmentVertical }) { - using (Brush textBrush = new SolidBrush(Options.Color)) - { - g.DrawString(Text, font, textBrush, Rectangle, sf); - } + g.DrawString(Text, font, textBrush, Rectangle, sf); } } diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingOptions.cs b/ShareX.ScreenCaptureLib/Shapes/TextDrawingOptions.cs similarity index 100% rename from ShareX.ScreenCaptureLib/Shapes/Drawing/TextDrawingOptions.cs rename to ShareX.ScreenCaptureLib/Shapes/TextDrawingOptions.cs diff --git a/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj b/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj index aa7bbf706..bc8f24b3c 100644 --- a/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj +++ b/ShareX.ScreenCaptureLib/ShareX.ScreenCaptureLib.csproj @@ -59,7 +59,7 @@ - + Form @@ -92,7 +92,7 @@ - +