Skip to content
Snippets Groups Projects
Forked from Jonathan Wilkes / purr-data
1654 commits behind the upstream repository.
Jonathan Wilkes's avatar
Jonathan Wilkes authored
This makes it possible to define an editable viewport outside of which the
contents are clipped.

One big benefit is that the getrect routine doesn't need to fetch the bboxes
of the shapes inside the viewport. It just needs the svg width, height, x,
y, and parent transform. It's also possible to add an optimized branch if
there is no parent transform specified.

One drawback is that the HTML5 method getBBox() includes the clipped content
in its calculation. That means the user will get scrollbars even though the
[draw svg] is clipping the contents which cause the scrollbars. Hopefully we
can just work around this by adding a "scrollbars" method for canvases to
just turn them off altogether.

Code for an experimental [draw array] is also added here. Combining it with
the viewport of [draw svg] will make it possible to interact with arrays of
widgets without the performance penalty normally associated with mouse
motion on Pd canvases.

Also:
* fixes some display bugs in certain cases for [draw image] and
[draw sprite]
* adds a default png for both [draw image] and [draw sprite] if none are
given
e16e7453
History