# File lib/origami/graphics/state.rb, line 60 def reset @ctm = Matrix.identity(3) @clipping_path = nil @stroking_colorspace = @nonstroking_colorspace = Color::Space::DEVICE_GRAY @stroking_color = @nonstroking_color = [ 0.0 ] #black @text_state.reset @line_width = 1.0 @line_cap = LineCapStyle::BUTT_CAP @line_join = LineJoinStyle::MITER_JOIN @miter_limit = 10.0 @dash_pattern = DashPattern.new([], 0) @rendering_intent = Color::Intent::RELATIVE @stroke_adjustment = false @blend_mode = Color::BlendMode::NORMAL @soft_mask = :None @alpha_constant = 1.0 @alpha_source = false end
# File lib/origami/graphics/state.rb, line 95 def restore raise GraphicsStateError, "Cannot restore context : empty stack" if @stack.empty? @ctm, @clipping_path, @stroking_colorspace, @nonstroking_colorspace, @stroking_color, @nonstroking_color, @text_state, @line_width, @line_cap, @line_join, @miter_limit, @dash_pattern, @rendering_intent, @stroke_adjustment, @blend_mode, @soft_mask, @alpha_constant, @alpha_source = @stack.pop end
# File lib/origami/graphics/state.rb, line 81 def save context = [ @ctm, @clipping_path, @stroking_colorspace, @nonstroking_colorspace, @stroking_color, @nonstroking_color, @text_state, @line_width, @line_cap, @line_join, @miter_limit, @dash_pattern, @rendering_intent, @stroke_adjustment, @blend_mode, @soft_mask, @alpha_constant, @alpha_source ] @stack.push(context) end
Generated with the Darkfish Rdoc Generator 2.