Browse Source

Fix reported TextView size when word-wrap is enabled and a word-wrap position is within a space character.

pull/23/head
Daniel Grunwald 14 years ago committed by Siegfried Pammer
parent
commit
086e15cc9a
  1. 10
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs

10
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/TextView.cs

@ -869,10 +869,7 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -869,10 +869,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
if (VisualLinesChanged != null)
VisualLinesChanged(this, EventArgs.Empty);
return new Size(
canHorizontallyScroll ? Math.Min(availableSize.Width, maxWidth) : maxWidth,
canVerticallyScroll ? Math.Min(availableSize.Height, heightTreeHeight) : heightTreeHeight
);
return new Size(Math.Min(availableSize.Width, maxWidth), Math.Min(availableSize.Height, heightTreeHeight));
}
/// <summary>
@ -1278,6 +1275,11 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -1278,6 +1275,11 @@ namespace ICSharpCode.AvalonEdit.Rendering
void SetScrollOffset(Vector vector)
{
if (!canHorizontallyScroll)
vector.X = 0;
if (!canVerticallyScroll)
vector.Y = 0;
if (!scrollOffset.IsClose(vector)) {
scrollOffset = vector;
if (ScrollOffsetChanged != null)

Loading…
Cancel
Save