GHud.DisplayModule.CalcColumns C# (CSharp) Method

CalcColumns() protected method

protected CalcColumns ( System font ) : void
font System
return void
        protected void CalcColumns(System.Drawing.Font font)
        {
            if (!active || font == null)
                return;

            SizeF max_suf_bounds = dev.graph.MeasureString(big_suf, font, new Point(0, 0), fmt_default);
            max_suffix_width = (int)(max_suf_bounds.Width + 1);

            SizeF max_lab_bounds = dev.graph.MeasureString(big_lab, font, new Point(0, 0), fmt_default);
            max_lab_width = (int)(max_lab_bounds.Width);

            int small_col = max_lab_width;
            int large_col = (width - (small_col * 2)) / 2;

            line_offset = (float)Math.Round(font.GetHeight());

            if (two_column_labeled_offsets == null)
                two_column_labeled_offsets = new int[5];
            two_column_labeled_offsets[0] = xoff + 0;
            two_column_labeled_offsets[1] = xoff + small_col;
            two_column_labeled_offsets[2] = two_column_labeled_offsets[1] + large_col;
            two_column_labeled_offsets[3] = two_column_labeled_offsets[2] + small_col;
            two_column_labeled_offsets[4] = xoff + width;

            if (two_column_offsets == null)
                two_column_offsets = new int[3];
            two_column_offsets[0] = xoff + 0;
            two_column_offsets[1] = xoff + width / 2;
            two_column_offsets[2] = xoff + width;
        }