# File lib/maruku/ext/math/to_html.rb, line 79 def adjust_png(png, use_depth) src = png.src height_in_px = png.height depth_in_px = png.depth height_in_ex = height_in_px / pixels_per_ex depth_in_ex = depth_in_px / pixels_per_ex total_height_in_ex = height_in_ex + depth_in_ex style = "" style << "vertical-align: -#{depth_in_ex}ex;" if use_depth style << "height: #{total_height_in_ex}ex;" img = xelem('img') img['src'] = src img['style'] = style img['alt'] = "$#{self.math.strip}$" img['class'] = 'maruku-png' img end