Method: HDLRuby::Viz::Node#block_svg

Defined in:
lib/HDLRuby/hruby_viz.rb

#block_svg(n) ⇒ Object

Generate a block description SVG text for node +n+



3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
# File 'lib/HDLRuby/hruby_viz.rb', line 3579

def block_svg(n)
  res = "<rect fill=\"#fff\" fill-opacity=\"0.4\" stroke=\"#000\" " +
    "stroke-width=\"#{@scale/10.0}\" " +
    "stroke-dasharray=\"#{@scale/10.0},#{@scale/10.0}\" " +
    # "x=\"#{n.xpos*@scale}\" y=\"#{n.ypos*@scale}\" " +
    # "rx=\"#{@scale*2.0}\" " +
    # "width=\"#{n.width*@scale}\" "+
    # "height=\"#{n.height*@scale}\"/>\n"
    "x=\"#{(n.xpos-0.3)*@scale}\" y=\"#{(n.ypos-0.3)*@scale}\" " +
    "rx=\"#{@scale*0.6}\" " +
    "width=\"#{(n.width+0.6)*@scale}\" "+
    "height=\"#{(n.height+0.6)*@scale}\"/>\n"
  return res
end