コード例 #1
0
ファイル: UITools.cs プロジェクト: xeronith/flashdevelop
        /// <summary>
        /// Compute current editor line height
        /// </summary>
        public int LineHeight(ScintillaControl sci)
        {
            if (sci == null)
            {
                return(0);
            }
            // evaluate the font size
            Font     tempFont = new Font(sci.Font.Name, sci.Font.Size + sci.ZoomLevel);
            Graphics g        = sci.CreateGraphics();
            SizeF    textSize = g.MeasureString("S", tempFont);

            return((int)Math.Ceiling(textSize.Height));
        }