Skip to content
Snippets Groups Projects
Commit e16e7453 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Add "svg" type for [draw svg] containers

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
parent 3215f70f
No related branches found
No related tags found
Loading
Showing
with 308 additions and 29 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment