Class: Postsvg::Translation::Handlers::GroupHandler

Inherits:
Object
  • Object
show all
Extended by:
Shared
Defined in:
lib/postsvg/translation/handlers/group_handler.rb

Class Method Summary collapse

Methods included from Shared

emit_fill, emit_paint, emit_paint_setup, emit_stroke, emit_transform, expand_bbox

Class Method Details

.call(element, context) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/postsvg/translation/handlers/group_handler.rb', line 9

def self.call(element, context)
  context.emitter.emit(Model::Operators::GraphicsState::Gsave.new)
  emit_transform(element, context)
  emit_paint_setup(element, context)
  element.children.each do |child|
    Postsvg::Translation::PsRenderer::DEFAULT_REGISTRY.translate(child, context)
  end
  context.emitter.emit(Model::Operators::GraphicsState::Grestore.new)
end