Sha256: a39a1587a4da46c635711322617de680fe406d43cee441d2f076889be908c2fa

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

# if block['flip'] == "yes"
#   @pdf.save
#   @pdf.translate block["x"].to_f + block["x2"].to_f, block["y"].to_f + block["y2"].to_f
#   @pdf.rotate 180
#   @pdf.fit_textflow flow, block["x"].to_f, block["y"].to_f, block["x2"].to_f, block["y2"].to_f, ""
#   @pdf.restore
# else

require File.dirname(__FILE__) + "/../../node/base"
require "PDFlib"
module FN
  module PDF
    module Node
      def Invert(block)
        FN::Node::Base("invert", 
              :x  => block["x"], 
              :y  => block["y"],
              :x2 => block["x"].to_f + (block["boxWidth"] || block["width"]).to_f,
              :y2 => block["y"].to_f + (block["boxHeight"] || block["height"]).to_f
            ).extend(Invert)
      end
      
      module Invert 
        include FN::Node::Base
      
        def visit(struct)
          struct.save
          struct.translate self["x"].to_f + self["x2"].to_f, self["y"].to_f + self["y2"].to_f
          struct.rotate 180
          visit_children struct
          struct.restore
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fn_document-0.9.2 lib/fn/pdf/node/invert.rb