Skip to content

Commit

Permalink
Paddings bug was fixed. Drawing artefacts were fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Torgashov committed Oct 12, 2014
1 parent 8f69ebf commit bf4d30b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
Binary file modified Binary/FastColoredTextBox.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions Binary/FastColoredTextBox.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Binary/Tester.exe
Binary file not shown.
11 changes: 8 additions & 3 deletions FastColoredTextBox/FastColoredTextBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ public Color ServiceLinesColor
[Description("Paddings of text area.")]
public Padding Paddings { get; set; }

//hide parent padding
/// <summary>
/// --Do not use this property--
/// </summary>
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
EditorBrowsable(EditorBrowsableState.Never)]
public new Padding Padding
Expand Down Expand Up @@ -4780,7 +4782,7 @@ protected override void OnPaint(PaintEventArgs e)
var sw = Stopwatch.StartNew();
#endif
visibleMarkers.Clear();
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
e.Graphics.SmoothingMode = SmoothingMode.None;
//
var servicePen = new Pen(ServiceLinesColor);
Brush changedLineBrush = new SolidBrush(ChangedLineColor);
Expand Down Expand Up @@ -4834,6 +4836,9 @@ protected override void OnPaint(PaintEventArgs e)
//
int startLine = YtoLineIndex(VerticalScroll.Value);
int iLine;

e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;

//draw text
for (iLine = startLine; iLine < lines.Count; iLine++)
{
Expand Down Expand Up @@ -5506,7 +5511,7 @@ private void DoZoom(float koeff)

//restore first displayed line
if (iLine < LinesCount)
VerticalScroll.Value = Math.Min(VerticalScroll.Maximum, LineInfos[iLine].startY);
VerticalScroll.Value = Math.Min(VerticalScroll.Maximum, LineInfos[iLine].startY - Paddings.Top);
UpdateScrollbars();
//
Invalidate();
Expand Down
4 changes: 2 additions & 2 deletions FastColoredTextBox/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.16.0.0")]
[assembly: AssemblyFileVersion("2.16.0.0")]
[assembly: AssemblyVersion("2.16.1.0")]
[assembly: AssemblyFileVersion("2.16.1.0")]

2 changes: 1 addition & 1 deletion Tester/PowerfulSample.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf4d30b

Please sign in to comment.