Class: Emfsvg::CoordinateState

Inherits:
Object
  • Object
show all
Defined in:
lib/emfsvg/device_context.rb

Overview

Coordinate state that lives OUTSIDE the device-context stack in libemf2svg (MapMode, window/viewport extents and origins). The C code keeps these on drawingStates directly, NOT on EMF_DEVICE_CONTEXT, so SaveDC/RestoreDC never saves/restores them. They persist as global state for the duration of the render.

This is a mutable struct shared by reference across every dup'd DeviceContext — when visit_set_map_mode changes the map mode, every DC observes the new value, even ones that were saved earlier.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCoordinateState

Returns a new instance of CoordinateState.



18
19
20
21
22
23
24
25
26
# File 'lib/emfsvg/device_context.rb', line 18

def initialize
  @map_mode = 1 # MM_TEXT
  @window_ext = [0, 0]
  @viewport_ext = [0, 0]
  @window_org = [0, 0]
  @viewport_org = [0, 0]
  @window_ext_set = false
  @viewport_ext_set = false
end

Instance Attribute Details

#map_modeObject

Returns the value of attribute map_mode.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def map_mode
  @map_mode
end

#viewport_extObject

Returns the value of attribute viewport_ext.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def viewport_ext
  @viewport_ext
end

#viewport_ext_setObject

Returns the value of attribute viewport_ext_set.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def viewport_ext_set
  @viewport_ext_set
end

#viewport_orgObject

Returns the value of attribute viewport_org.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def viewport_org
  @viewport_org
end

#window_extObject

Returns the value of attribute window_ext.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def window_ext
  @window_ext
end

#window_ext_setObject

Returns the value of attribute window_ext_set.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def window_ext_set
  @window_ext_set
end

#window_orgObject

Returns the value of attribute window_org.



14
15
16
# File 'lib/emfsvg/device_context.rb', line 14

def window_org
  @window_org
end