示例#1
0
        /// <summary>
        ///
        /// </summary>
        protected override void OnPreviewMouseWheel(MouseState mouseState, ref bool handled)
        {
            if (mouseState.IsCtrl)
            {
                _zoomLevel += mouseState.WheelNotchY;
#warning とりあえず
                _zoomLevel = MathUtil.Clamp(_zoomLevel, -10, 22);
                ZoomRate   = Math.Pow(1.1, _zoomLevel);

                AsciiFont.Dispose();
                AsciiFont = CanvasContext.CreateFont(_settings.fonts.asciiFont.name, _settings.fonts.asciiFont.height * ZoomRate);
                JpFont.Dispose();
                JpFont = CanvasContext.CreateFont(_settings.fonts.jpFont.name, _settings.fonts.jpFont.height * ZoomRate);

                UpdateLayout();

                FontChanged?.Invoke();
            }
            else
            {
                if (mouseState.IsShift)
                {
                    HScrollBar.Value += mouseState.WheelNotchY * _settings.scrollSpeed_horizontal * -1;
                }
                else
                {
                    VScrollBar.Value += mouseState.WheelNotchY * _settings.scrollSpeed_vertical * -1;
                }
            }

            handled = true;
        }
示例#2
0
 internal int GetLineHeight()
 {
     return(CharSize.RoundHeight(
                Math.Max(AsciiFont.MeasureChar('A').Height, JpFont.MeasureChar('あ').Height) + _settings.lineHeightAdjust));
 }