Sha256: 7eab7327c88f4b4781c4c37b6b1ebdb85651d2111f98deddda7a4d162df6c64c

Contents?: true

Size: 696 Bytes

Versions: 13

Compression:

Stored size: 696 Bytes

Contents

module Savage
  module Directions
    class ArcTo < PointTarget
      attr_accessor :radius, :rotation, :large_arc, :sweep
    
      def initialize(radius_x, radius_y, rotation, large_arc, sweep, target_x, target_y, absolute=true)
        super(target_x, target_y, absolute)
        @radius = Point.new(radius_x, radius_y)
        @rotation = rotation
        @large_arc = large_arc
        @sweep = sweep
      end
    
      def to_command
        command_code << "#{@radius.x} #{@radius.y} #{@rotation} #{bool_to_int(@large_arc)} #{bool_to_int(@sweep)} #{target.x} #{target.y}".gsub(/ -/,'-')
      end
      
      def command_code
        (absolute?) ? 'A' : 'a'
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
savage-1.1.7 lib/savage/directions/arc_to.rb
savage-1.1.6 lib/savage/directions/arc_to.rb
savage-1.1.5 lib/savage/directions/arc_to.rb
savage-1.1.4 lib/savage/directions/arc_to.rb
savage-1.1.3 lib/savage/directions/arc_to.rb
savage-1.1.2 lib/savage/directions/arc_to.rb
savage-1.1.1 lib/savage/directions/arc_to.rb
savage-1.1.0 lib/savage/directions/arc_to.rb
savage-1.0.3 lib/savage/directions/arc_to.rb
savage-1.0.2 lib/savage/directions/arc_to.rb
savage-1.0.1 lib/savage/directions/arc_to.rb
savage-1.0.0 lib/savage/directions/arc_to.rb
savage-0.2.0 lib/savage/directions/arc_to.rb