Class: Emfsvg::CoordinateState
- Inherits:
-
Object
- Object
- Emfsvg::CoordinateState
- 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
-
#map_mode ⇒ Object
Returns the value of attribute map_mode.
-
#viewport_ext ⇒ Object
Returns the value of attribute viewport_ext.
-
#viewport_ext_set ⇒ Object
Returns the value of attribute viewport_ext_set.
-
#viewport_org ⇒ Object
Returns the value of attribute viewport_org.
-
#window_ext ⇒ Object
Returns the value of attribute window_ext.
-
#window_ext_set ⇒ Object
Returns the value of attribute window_ext_set.
-
#window_org ⇒ Object
Returns the value of attribute window_org.
Instance Method Summary collapse
-
#initialize ⇒ CoordinateState
constructor
A new instance of CoordinateState.
Constructor Details
#initialize ⇒ CoordinateState
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_mode ⇒ Object
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_ext ⇒ Object
Returns the value of attribute viewport_ext.
14 15 16 |
# File 'lib/emfsvg/device_context.rb', line 14 def @viewport_ext end |
#viewport_ext_set ⇒ Object
Returns the value of attribute viewport_ext_set.
14 15 16 |
# File 'lib/emfsvg/device_context.rb', line 14 def @viewport_ext_set end |
#viewport_org ⇒ Object
Returns the value of attribute viewport_org.
14 15 16 |
# File 'lib/emfsvg/device_context.rb', line 14 def @viewport_org end |
#window_ext ⇒ Object
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_set ⇒ Object
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_org ⇒ Object
Returns the value of attribute window_org.
14 15 16 |
# File 'lib/emfsvg/device_context.rb', line 14 def window_org @window_org end |