/** * Create a fraction area. * This is an area that consists of 2 areas vertically separated by a line. * this notion natuarally falls into the conecpt of a vertical array area, * an area, a line, and the second area. */ public static Area Fraction(IFormattingContext ctx, Area numerator, Area denominator, float lineThickness) { Area space = new VerticalSpaceArea(ctx.OnePixel, ctx.OnePixel); Area line = HorizontalLine(ctx.OnePixel); numerator = HorizontalCenter(numerator); denominator = HorizontalCenter(denominator); Area[] areas = { denominator, space, line, space, numerator }; return(Shift(ctx.Axis, new VerticalArea(areas, 2))); }
/** * Create a fraction area. * This is an area that consists of 2 areas vertically separated by a line. * this notion natuarally falls into the conecpt of a vertical array area, * an area, a line, and the second area. */ public static Area Fraction(IFormattingContext ctx, Area numerator, Area denominator, float lineThickness) { Area space = new VerticalSpaceArea(ctx.OnePixel, ctx.OnePixel); Area line = HorizontalLine(ctx.OnePixel); numerator = HorizontalCenter(numerator); denominator = HorizontalCenter(denominator); Area[] areas = {denominator, space, line, space, numerator}; return Shift(ctx.Axis, new VerticalArea(areas, 2)); }