Class: Origami::Destination::RectangleFit

Inherits:
Origami::Destination show all
Defined in:
lib/origami/destinations.rb

Overview

Class representing a Destination fitting the view on a rectangle in a Page.

Constant Summary

Constants inherited from Array

Array::TOKENS

Constants included from Object

Object::TOKENS

Instance Attribute Summary

Attributes inherited from Origami::Destination

#bottom, #left, #page, #right, #top, #zoom

Attributes inherited from Array

#names_cache, #strings_cache, #xref_cache

Attributes included from Object

#file_offset, #generation, #no, #objstm_offset, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Origami::Destination

GlobalBoundingBoxFit, GlobalFit, HorizontalBoudingBoxFit, HorizontalFit, RectangleFit, VerticalBoundingBoxFit, VerticalFit, Zoom

Methods inherited from Array

#+, #<<, #[]=, #cast_to, #concat, #copy, of, parse, #pre_build, #to_a, #to_obfuscated_str, #to_s

Methods included from Object

#<=>, #cast_to, #copy, #document, #export, included, #indirect?, #indirect_parent, #logicalize, #logicalize!, #native_type, parse, #post_build, #pre_build, #reference, #set_document, #set_indirect, skip_until_next_obj, #solve, #to_o, #to_s, #type, typeof, #version_required, #xrefs

Constructor Details

#initialize(array) ⇒ RectangleFit

Returns a new instance of RectangleFit.



148
149
150
151
152
# File 'lib/origami/destinations.rb', line 148

def initialize(array)
    super(array)

    @page, _, @left, @bottom, @right, @top = array
end

Class Method Details

.[](page, left: 0, bottom: 0, right: 0, top: 0) ⇒ Object

Creates a new rectangle fit Destination.

page

The destination Page.

left, bottom, right, top

The rectangle to fit in.



159
160
161
# File 'lib/origami/destinations.rb', line 159

def self.[](page, left: 0, bottom: 0, right: 0, top: 0)
    self.new([page, :FitR, left, bottom, right, top])
end