Beispiel #1
0
        private void NotifyHorizonalScroll(ExtentInfo extentInfo)
        {
            var startCharacter = Math.Ceiling(_offset.X / CharacterWidth);

            //Console.WriteLine("{0}/{1}. Total={2}",startCharacter, extentInfo.MaximumChars,this.TotalCharacters);
            HorizontalScrollChanged?.Invoke(new TextScrollInfo((int)startCharacter, (int)extentInfo.MaximumChars));
        }
Beispiel #2
0
        private void NotifyHorizonalScroll(ExtentInfo extentInfo)
        {
            var startCharacter = Math.Ceiling(_offset.X / CharacterWidth);

            //clamp when required
            if (startCharacter + extentInfo.MaximumChars > TotalCharacters)
            {
                startCharacter = Math.Max(0, TotalCharacters - extentInfo.MaximumChars);
            }

            HorizontalScrollChanged?.Invoke(new TextScrollInfo((int)startCharacter, (int)extentInfo.MaximumChars));
        }