Skip to content
Permalink
Browse files

Some docstring updates, and add wx.svg to the docs to be built

  • Loading branch information...
Robin Dunn authored and RobinD42 committed Aug 8, 2019
1 parent 43c2b5c commit d6bda86a0ee2991ea7ef4b1abbf7c9d24fc814f2
Showing with 21 additions and 3 deletions.
  1. +1 −1 build.py
  2. +9 −0 docs/sphinx/rest_substitutions/overviews/index.rst
  3. +11 −2 wx/svg/__init__.py
@@ -1095,7 +1095,7 @@ def cmd_wxlib(options, args):
cmdTimer = CommandTimer('wx.lib')
pwd = pushDir(phoenixDir())

for wx_pkg in ['lib', 'py', 'tools']:
for wx_pkg in ['lib', 'py', 'svg', 'tools']:
libDir = os.path.join(phoenixDir(), 'wx', wx_pkg)

if not os.path.isdir(libDir):
@@ -74,6 +74,8 @@ and launch the wxPython demo for you.
<p class="mybiglink"><a class="mybiglink" href="wx.aui.1moduleindex.html">wx.aui</a><br/>
<span class="linkdescr">Docking/floating window panes, draggable notebook tabs, etc.</span></p>

<p class="mybiglink"><a class="mybiglink" href="wx.svg.html">wx.svg</a><br/>
<span class="linkdescr">Classes to parse and render Scalable Vector Graphics files.</span></p>

</td>
<td valign="top" width="50%" style="margin-left: 5px">
@@ -149,3 +151,10 @@ and launch the wxPython demo for you.
wx.lib
wx.py
wx.tools
wx.svg

.. automodule:: wx.svg._nanosvg
:members:
:undoc-members:
:show-inheritance:

@@ -10,7 +10,9 @@
# Licence: wxWindows license
#----------------------------------------------------------------------
"""
wx.svg docstring (TBW)
"""

import wx
from six.moves import zip_longest

@@ -21,21 +23,28 @@
# let's leave this in place in case it's needed again in the future.
_RenderersWithoutGradientTransforms = []


class SVGimage(SVGimageBase):
"""
SVGimage docstring (TBW)
"""

def RasterizeToBitmap(self, tx=0.0, ty=0.0, scale=1.0,
width=-1, height=-1, stride=-1):
"""
SVGimage.RasterizeToBitmap docstring (TBW)
"""
buff = self.RasterizeToBytes(tx, ty, scale, width, height, stride)
bmp = wx.Bitmap.FromBufferRGBA(width, height, buff)
buf = self.RasterizeToBytes(tx, ty, scale, width, height, stride)
# import numpy as np
# buf = np.zeros((width, height, 4), np.uint8)
# self.RasterizeToBuffer(buf, tx, ty, scale, width, height, stride)
bmp = wx.Bitmap.FromBufferRGBA(width, height, buf)
return bmp


def RenderToGC(self, ctx, scale=None, size=None, translate=(0.0, 0.0)):
"""
SVGimage.RenderToGC docstring (TBW)
"""
ctx.PushState()
# set scale either from the parameter or as ratio of sizes

0 comments on commit d6bda86

Please sign in to comment.
You can’t perform that action at this time.