lib/render.rb in xrvg-0.0.3 vs lib/render.rb in xrvg-0.0.4
- old
+ new
@@ -5,10 +5,11 @@
require 'color'
require 'attributable'
require 'style'
+module XRVG
# Render abstract class
#
# Is pretty useless for the moment
class Render
include Attributable
@@ -77,14 +78,12 @@
@layers[ layer ] += string
end
def svg_template #:nodoc:
return '<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg width="%SIZE%" height="%SIZE%" %VIEWBOX% version="1.1"
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg width="%SIZE%" height="%SIZE%" %VIEWBOX% version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
%DEFS%
%BACKGROUND%
%CONTENT%
</svg>'
end
@@ -108,14 +107,10 @@
def add(object, style=nil, layer=0, type=:object)
add_content( render( object, style ), layer)
refresh_viewbox( object )
end
- def adds (objects) #:nodoc:
- objects.each { |object| add( object )}
- end
-
def render (object, style=nil) #:nodoc:
owidth, oheight = object.size
res = 0.0000001
if owidth < res and oheight < res
@@ -266,7 +261,7 @@
# bg = background.format255
# Kernel.system( "ruby", "svg2png.rb", filename(), "2.0" )
# Kernel.system( "i_view32", filename().subreplace( ".svg" => ".png" ), "/fs" )
end
-
+end
end