Sha256: e7bb1c285f7e0fa5f6878703bdbff2c3508aa65e0d45b12518a700a7c154778f

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

module Rubyvis
  module SvgScene
    def self.rule(scenes)
      e=scenes._g.elements[1]
      scenes.each_with_index do |s,i|
        next unless s.visible
        stroke=s.stroke_style
        next if(!stroke.opacity)
        e=SvgScene.expect(e,'line', {
          "shape-rendering"=> s.antialias ? nil : "crispEdges",
          "pointer-events"=> s.events,
          "cursor"=> s.cursor,
          "x1"=> s.left,
          "y1"=> s.top,
          'x2'=> s.left+s.width,
          'y2'=>s.top+s.height,
          "stroke"=> stroke.color,
          "stroke-opacity"=> stroke.opacity,
          "stroke-width"=> s.line_width/self.scale.to_f
        })

        e=SvgScene.append(e,scenes,i)

      end
      e
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyvis-0.1.2 lib/rubyvis/scene/svg_rule.rb