Skip to content
Snippets Groups Projects

Add "svg" type for [draw svg] containers

Merged Jonathan Wilkes requested to merge drawsvg into master

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

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
Please register or sign in to reply
Loading