Closed GoogleCodeExporter closed 9 years ago
As per the eggbot.py code, these two parameters are not currently handled. At
the time I added support for the viewBox attribute, I did not have any real
world examples of viewBox attributes using non-zero values for the min-x and
min-y parameters. They appear almost as afterthoughts in the SVG 1.1 spec:
there is no explanation of them, no examples, and only a very brief note about
them.
Now that I have a real example in hand, I have added support for them in my
private copy of eggbot.py. Once I have a chance to test this on an "egg", I'll
go ahead and check the change in to the SVN repo.
Original comment by newman.d...@gmail.com
on 5 Feb 2011 at 4:04
See also Issue 33
Original comment by newman.d...@gmail.com
on 5 Feb 2011 at 4:06
Change seems to work in this case (1:1 rescaling). I've tested with the
provided sample on my Eggbot. Changes checked in.
% svn diff eggbot.py
Index: eggbot.py
===================================================================
--- eggbot.py (revision 198)
+++ eggbot.py (working copy)
@@ -515,7 +515,6 @@
return
# Viewbox handling
- # Presently ignores minx, miny info (translation)
# Also ignores the preserveAspectRatio attribute
viewbox = self.svg.get( 'viewBox' )
if viewbox:
@@ -523,7 +522,7 @@
if ( vinfo[2] != 0 ) and ( vinfo[3] != 0 ):
sx = self.svgWidth / float( vinfo[2] )
sy = self.svgHeight / float( vinfo[3] )
- self.svgTransform = parseTransform( 'scale(%f,%f)' % (sx, sy) )
+ self.svgTransform = parseTransform( 'scale(%f,%f) translate(%f,%f)' % (sx,
sy, -float( vinfo[0] ), -float( vinfo[1] ) ) )
self.ServoSetup()
Original comment by newman.d...@gmail.com
on 5 Feb 2011 at 4:29
Original issue reported on code.google.com by
newman.d...@gmail.com
on 5 Feb 2011 at 4:00