Browse Source

Merge pull request #1166 from SmithsonianDSP/patch-1

Modify RichTextBoxFormatBarManager.cs to fix #1165
Fix is included in v3.6 and merged in current v3.1
pull/1181/head
XceedBoucherS 9 years ago
committed by GitHub
parent
commit
264b0b54bc
  1. 16
      ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs

16
ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/RichTextBoxFormatBar/RichTextBoxFormatBarManager.cs

@ -210,13 +210,25 @@ namespace Xceed.Wpf.Toolkit
//top //top
if( top < 0 ) if( top < 0 )
{ {
top = mousePosition.Y + 10; top = Math.Max( mousePosition.Y + 10, 5 );
}
// bottom
if ( top + adorningEditor.ActualHeight > _richTextBox.ActualHeight - 20 )
{
top = _richTextBox.ActualHeight - adorningEditor.ActualHeight - 20;
}
// left boundary
if ( left < 0 )
{
left = 5;
} }
//right boundary //right boundary
if( left + adorningEditor.ActualWidth > _richTextBox.ActualWidth - 20 ) if( left + adorningEditor.ActualWidth > _richTextBox.ActualWidth - 20 )
{ {
left = left - ( adorningEditor.ActualWidth - ( _richTextBox.ActualWidth - left ) ); left = _richTextBox.ActualWidth - adorningEditor.ActualWidth - 20;
} }
_adorner.SetOffsets( left, top ); _adorner.SetOffsets( left, top );

Loading…
Cancel
Save