Class: Emfsvg::Translation::Handlers::PolylineHandler

Inherits:
Object
  • Object
show all
Includes:
Emf::Emr::Binary::TypeCodes, SharedGdi
Defined in:
lib/emfsvg/translation/handlers/polyline_handler.rb

Overview

Translate to EMR_POLYLINE.

Direct Known Subclasses

PolygonHandler

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SharedGdi

#clip_bounds_for, #emit_create_brush, #emit_create_pen, #emit_delete, #emit_restore_dc, #emit_save_dc, #with_gdi_state

Class Method Details

.call(element, context) ⇒ Object



13
14
15
# File 'lib/emfsvg/translation/handlers/polyline_handler.rb', line 13

def self.call(element, context)
  new.translate(element, context)
end

Instance Method Details

#translate(element, context) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/emfsvg/translation/handlers/polyline_handler.rb', line 17

def translate(element, context)
  return if element.points.empty?

  with_gdi_state(element, context) do
    emit_poly(element.points, element, context)
  end
end