# File lib/cairo/context/path.rb, line 4 def transform_path(path, &block) transformed_path = Cairo::Path.new path.each do |type, points| case type when PATH_MOVE_TO transformed_path.move_to(*points.collect(&block).flatten) when PATH_LINE_TO transformed_path.line_to(*points.collect(&block).flatten) when PATH_CURVE_TO transformed_path.curve_to(*points.collect(&block).flatten) when PATH_CLOSE_PATH transformed_path.close end end transformed_path end